Browse Source

add support for Windows 7 TaskbarItem progress display

pull/469/merge
Siegfried Pammer 11 years ago
parent
commit
9ceb8de922
  1. 11
      ILSpy/MainWindow.xaml
  2. 8
      ILSpy/TextView/DecompilerTextView.cs

11
ILSpy/MainWindow.xaml

@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
FocusManager.FocusedElement="{Binding ElementName=treeView}"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d:DesignHeight="500" d:DesignWidth="500"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
>
>
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</Window.Resources>
@ -39,6 +39,9 @@ @@ -39,6 +39,9 @@
Command="Search"
Executed="SearchCommandExecuted" />
</Window.CommandBindings>
<Window.TaskbarItemInfo>
<TaskbarItemInfo />
</Window.TaskbarItemInfo>
<DockPanel>
<!-- Main menu -->
<Menu DockPanel.Dock="Top" Name="mainMenu" Height="23">
@ -148,8 +151,8 @@ @@ -148,8 +151,8 @@
</Border>
<controls:DockedPane x:Name="topPane" Grid.Row="1" Title="Top" Visibility="Collapsed"
CloseButtonClicked="TopPane_CloseButtonClicked" Margin="0,0,0,3"
BorderThickness="1,1,0,1" />
CloseButtonClicked="TopPane_CloseButtonClicked" Margin="0,0,0,3"
BorderThickness="1,1,0,1" />
<GridSplitter
Grid.ZIndex="1"
@ -175,7 +178,7 @@ @@ -175,7 +178,7 @@
Visibility="{Binding Visibility, ElementName=bottomPane}" />
<controls:DockedPane x:Name="bottomPane" Grid.Row="5" Title="Bottom" Visibility="Collapsed"
CloseButtonClicked="BottomPane_CloseButtonClicked" Margin="0,3,0,0" BorderThickness="1,1,0,1"/>
CloseButtonClicked="BottomPane_CloseButtonClicked" Margin="0,3,0,0" BorderThickness="1,1,0,1"/>
</Grid>
</Grid>
</DockPanel>

8
ILSpy/TextView/DecompilerTextView.cs

@ -226,6 +226,10 @@ namespace ICSharpCode.ILSpy.TextView @@ -226,6 +226,10 @@ namespace ICSharpCode.ILSpy.TextView
if (waitAdorner.Visibility != Visibility.Visible) {
waitAdorner.Visibility = Visibility.Visible;
waitAdorner.BeginAnimation(OpacityProperty, new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(0.5)), FillBehavior.Stop));
var taskBar = MainWindow.Instance.TaskbarItemInfo;
if (taskBar != null) {
taskBar.ProgressState = System.Windows.Shell.TaskbarItemProgressState.Indeterminate;
}
}
CancellationTokenSource previousCancellationTokenSource = currentCancellationTokenSource;
var myCancellationTokenSource = new CancellationTokenSource();
@ -248,6 +252,10 @@ namespace ICSharpCode.ILSpy.TextView @@ -248,6 +252,10 @@ namespace ICSharpCode.ILSpy.TextView
if (currentCancellationTokenSource == myCancellationTokenSource) {
currentCancellationTokenSource = null;
waitAdorner.Visibility = Visibility.Collapsed;
var taskBar = MainWindow.Instance.TaskbarItemInfo;
if (taskBar != null) {
taskBar.ProgressState = System.Windows.Shell.TaskbarItemProgressState.None;
}
if (task.IsCanceled) {
AvalonEditTextOutput output = new AvalonEditTextOutput();
output.WriteLine("The operation was canceled.");

Loading…
Cancel
Save