Browse Source

add support for Windows 7 TaskbarItem progress display

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

5
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">

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