mirror of
https://github.com/vbondarevsky/OneCleaner.git
synced 2024-11-21 10:05:50 +02:00
Добавлены поля для вывода общего размера и освобождаемого. Без заполнения.
This commit is contained in:
parent
351f37edfe
commit
f2622e1e22
@ -41,24 +41,36 @@
|
|||||||
<Window.TaskbarItemInfo>
|
<Window.TaskbarItemInfo>
|
||||||
<TaskbarItemInfo/>
|
<TaskbarItemInfo/>
|
||||||
</Window.TaskbarItemInfo>
|
</Window.TaskbarItemInfo>
|
||||||
<Grid>
|
<Grid Name="MainGrid">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="32"/>
|
<RowDefinition Height="32"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition Height="35"/>
|
<RowDefinition Height="40"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock TextWrapping="Wrap" Text="Получение списка установленных версий..." HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Foreground="#FF9C9C9C" Grid.Row="1"/>
|
<TextBlock TextWrapping="Wrap" Text="Получение списка установленных версий..." HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Foreground="#FF9C9C9C" Grid.Row="1"/>
|
||||||
<ListView x:Name="List" ItemTemplate="{StaticResource myItem}" PreviewKeyDown="List_PreviewKeyDown" Grid.Row="1"/>
|
<ListView x:Name="List" ItemTemplate="{StaticResource myItem}" PreviewKeyDown="List_PreviewKeyDown" Grid.Row="1"/>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2" Margin="10,7,5,5">
|
<Grid Grid.Row="2">
|
||||||
<Button x:Name="ButtonCancel" Content="Отменить" Visibility="Collapsed" Click="ButtonCancel_Click" Margin="0,0,3,0"/>
|
<Grid.ColumnDefinitions>
|
||||||
<Button x:Name="ButtonUninstall" Content="Выполнить удаление" Click="ButtonUninstall_Click" Margin="3,0,0,0"/>
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="150"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,6">
|
||||||
|
<Label Content="Всего:" Margin="0"/>
|
||||||
|
<Label Content="{Binding TotalSize}" Margin="0"/>
|
||||||
|
<Label Content="К удалению:" Margin="0"/>
|
||||||
|
<Label Content="{Binding FreeSize}" Margin="0"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0,6,6,6" HorizontalAlignment="Right">
|
||||||
|
<Button x:Name="ButtonCancel" Content="Отменить" Visibility="Collapsed" Click="ButtonCancel_Click" Margin="0"/>
|
||||||
|
<Button x:Name="ButtonUninstall" Content="Выполнить удаление" Click="ButtonUninstall_Click" Margin="6,0,0,0"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0">
|
||||||
<Button Margin="3 3" Background="{x:Null}" BorderThickness="0.4" Click="Button_Click" Width="25" Height="25">
|
<Button Margin="3 3" Background="{x:Null}" BorderThickness="0.4" Click="ButtonSelectAll_Click" Width="25" Height="25">
|
||||||
<Image Source="checked.png" Stretch="None" />
|
<Image Source="checked.png" Stretch="None" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Margin="3 3" Background="{x:Null}" BorderThickness="0.4" Click="Button_Click_2" Width="25" Height="25">
|
<Button Margin="3 3" Background="{x:Null}" BorderThickness="0.4" Click="ButtonUnselectAll_Click" Width="25" Height="25">
|
||||||
<Image Source="unchecked.png" Stretch="None" />
|
<Image Source="unchecked.png" Stretch="None" />
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
@ -4,9 +4,7 @@ using System.Linq;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Shell;
|
using System.Windows.Shell;
|
||||||
|
|
||||||
namespace OneCleaner
|
namespace OneCleaner
|
||||||
@ -16,6 +14,9 @@ namespace OneCleaner
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
|
public string TotalSize { get; set; }
|
||||||
|
public string FreeSize { get; set; }
|
||||||
|
|
||||||
private InstalledVersionUICollection _installedVersions = new InstalledVersionUICollection();
|
private InstalledVersionUICollection _installedVersions = new InstalledVersionUICollection();
|
||||||
private bool _cancelFlag = false;
|
private bool _cancelFlag = false;
|
||||||
|
|
||||||
@ -24,6 +25,12 @@ namespace OneCleaner
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
List.ItemsSource = _installedVersions;
|
List.ItemsSource = _installedVersions;
|
||||||
|
|
||||||
|
MainGrid.DataContext = this;
|
||||||
|
|
||||||
|
TotalSize = "0 MB";
|
||||||
|
FreeSize = "0 MB";
|
||||||
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
this.Title = this.Title + " (DEBUG)";
|
this.Title = this.Title + " (DEBUG)";
|
||||||
#endif
|
#endif
|
||||||
@ -65,26 +72,6 @@ namespace OneCleaner
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_Click_1(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
var item = FindVisualParent<ListItem>(sender as Button);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static T FindVisualParent<T>(DependencyObject childElement) where T : DependencyObject
|
|
||||||
{
|
|
||||||
DependencyObject parent = VisualTreeHelper.GetParent(childElement);
|
|
||||||
T parentAsT = parent as T;
|
|
||||||
if (parent == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
else if (parentAsT != null)
|
|
||||||
{
|
|
||||||
return parentAsT;
|
|
||||||
}
|
|
||||||
return FindVisualParent<T>(parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ButtonCancel_Click(object sender, RoutedEventArgs e)
|
private void ButtonCancel_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_cancelFlag = true;
|
_cancelFlag = true;
|
||||||
@ -111,7 +98,7 @@ namespace OneCleaner
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_Click(object sender, RoutedEventArgs e)
|
private void ButtonSelectAll_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
foreach (var item in _installedVersions)
|
foreach (var item in _installedVersions)
|
||||||
{
|
{
|
||||||
@ -119,7 +106,7 @@ namespace OneCleaner
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_Click_2(object sender, RoutedEventArgs e)
|
private void ButtonUnselectAll_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
foreach (var item in _installedVersions)
|
foreach (var item in _installedVersions)
|
||||||
{
|
{
|
||||||
@ -163,7 +150,6 @@ namespace OneCleaner
|
|||||||
this.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None;
|
this.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None;
|
||||||
|
|
||||||
SetWindowStateIdle();
|
SetWindowStateIdle();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user