mirror of https://github.com/icsharpcode/ILSpy.git
9 changed files with 134 additions and 82 deletions
@ -1,23 +0,0 @@ |
|||||||
<Window x:Class="ICSharpCode.ILSpy.AboutDialog" x:ClassModifier="internal" |
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
||||||
xmlns:local="clr-namespace:ICSharpCode.ILSpy" |
|
||||||
Title="About ILSpy" |
|
||||||
Style="{DynamicResource DialogWindow}" |
|
||||||
ResizeMode="NoResize" |
|
||||||
WindowStartupLocation="CenterOwner" |
|
||||||
SizeToContent="WidthAndHeight"> |
|
||||||
<StackPanel Margin="8"> |
|
||||||
<TextBlock TextWrapping="WrapWithOverflow" FontSize="12"> |
|
||||||
ILSpy version <Run Text="{x:Static local:AboutDialog.Version}"/>.<LineBreak/> |
|
||||||
Copyright 2011 by AlphaSierraPapa for the SharpDevelop Team.<LineBreak/> |
|
||||||
Website: <Hyperlink NavigateUri="http://www.ilspy.net/">http://www.ilspy.net/</Hyperlink><LineBreak/> |
|
||||||
<LineBreak/> |
|
||||||
This software makes use of the following open-source projects:<LineBreak/> |
|
||||||
<Hyperlink NavigateUri="http://www.mono-project.com/Cecil">Mono.Cecil</Hyperlink> (reading IL)<LineBreak/> |
|
||||||
<Hyperlink NavigateUri="http://www.avalonedit.net/">ICSharpCode.AvalonEdit</Hyperlink><LineBreak/> |
|
||||||
<Hyperlink NavigateUri="http://www.sharpdevelop.net/">SharpDevelop</Hyperlink> components (SharpTreeView, NRefactory)<LineBreak/> |
|
||||||
</TextBlock> |
|
||||||
<Button IsCancel="True" HorizontalAlignment="Center">Close</Button> |
|
||||||
</StackPanel> |
|
||||||
</Window> |
|
@ -1,45 +0,0 @@ |
|||||||
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
|
|
||||||
//
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
|
||||||
// software and associated documentation files (the "Software"), to deal in the Software
|
|
||||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
|
||||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
|
||||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be included in all copies or
|
|
||||||
// substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
||||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
||||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
|
||||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
||||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
// DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Collections.Generic; |
|
||||||
using System.Text; |
|
||||||
using System.Windows; |
|
||||||
using System.Windows.Controls; |
|
||||||
using System.Windows.Data; |
|
||||||
using System.Windows.Documents; |
|
||||||
using System.Windows.Input; |
|
||||||
using System.Windows.Media; |
|
||||||
|
|
||||||
namespace ICSharpCode.ILSpy |
|
||||||
{ |
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for AboutDialog.xaml
|
|
||||||
/// </summary>
|
|
||||||
partial class AboutDialog : Window |
|
||||||
{ |
|
||||||
public AboutDialog() |
|
||||||
{ |
|
||||||
InitializeComponent(); |
|
||||||
} |
|
||||||
|
|
||||||
public static string Version { |
|
||||||
get { return RevisionClass.FullVersion; } |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,114 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
|
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Diagnostics; |
||||||
|
using System.IO; |
||||||
|
using System.Threading.Tasks; |
||||||
|
using System.Windows; |
||||||
|
using System.Windows.Controls; |
||||||
|
using System.Windows.Input; |
||||||
|
using ICSharpCode.Decompiler; |
||||||
|
using ICSharpCode.ILSpy.TextView; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy |
||||||
|
{ |
||||||
|
static class AboutPage |
||||||
|
{ |
||||||
|
static AvailableVersionInfo latestAvailableVersion; |
||||||
|
|
||||||
|
public static void Display(DecompilerTextView textView) |
||||||
|
{ |
||||||
|
AvalonEditTextOutput output = new AvalonEditTextOutput(); |
||||||
|
output.WriteLine("ILSpy version " + RevisionClass.FullVersion); |
||||||
|
output.AddUIElement( |
||||||
|
delegate { |
||||||
|
StackPanel stackPanel = new StackPanel(); |
||||||
|
stackPanel.Orientation = Orientation.Horizontal; |
||||||
|
if (latestAvailableVersion == null) { |
||||||
|
Button button = new Button(); |
||||||
|
button.Content = "Check for updates"; |
||||||
|
button.Cursor = Cursors.Arrow; |
||||||
|
stackPanel.Children.Add(button); |
||||||
|
|
||||||
|
button.Click += delegate { |
||||||
|
button.Content = "Checking..."; |
||||||
|
button.IsEnabled = false; |
||||||
|
GetLatestVersion().ContinueWith( |
||||||
|
delegate (Task<AvailableVersionInfo> task) { |
||||||
|
try { |
||||||
|
latestAvailableVersion = task.Result; |
||||||
|
stackPanel.Children.Clear(); |
||||||
|
ShowAvailableVersion(latestAvailableVersion, stackPanel); |
||||||
|
} catch (Exception ex) { |
||||||
|
AvalonEditTextOutput exceptionOutput = new AvalonEditTextOutput(); |
||||||
|
exceptionOutput.WriteLine(ex.ToString()); |
||||||
|
textView.Show(exceptionOutput); |
||||||
|
} |
||||||
|
}, TaskScheduler.FromCurrentSynchronizationContext()); |
||||||
|
}; |
||||||
|
} else { |
||||||
|
// we already retrieved the latest version sometime earlier
|
||||||
|
ShowAvailableVersion(latestAvailableVersion, stackPanel); |
||||||
|
} |
||||||
|
return stackPanel; |
||||||
|
}); |
||||||
|
output.WriteLine(); |
||||||
|
output.WriteLine(); |
||||||
|
using (Stream s = typeof(AboutPage).Assembly.GetManifestResourceStream(typeof(AboutPage), "README.txt")) { |
||||||
|
using (StreamReader r = new StreamReader(s)) { |
||||||
|
string line; |
||||||
|
while ((line = r.ReadLine()) != null) |
||||||
|
output.WriteLine(line); |
||||||
|
} |
||||||
|
} |
||||||
|
textView.Show(output); |
||||||
|
} |
||||||
|
|
||||||
|
static void ShowAvailableVersion(AvailableVersionInfo availableVersion, StackPanel stackPanel) |
||||||
|
{ |
||||||
|
Version currentVersion = new Version(RevisionClass.Major + "." + RevisionClass.Minor + "." + RevisionClass.Build + "." + RevisionClass.Revision); |
||||||
|
if (currentVersion == availableVersion.Version) { |
||||||
|
stackPanel.Children.Add(new Image { Width = 16, Height = 16, Source = Images.OK, Margin = new Thickness(4,0,4,0) }); |
||||||
|
stackPanel.Children.Add( |
||||||
|
new TextBlock { Text = "You are using the latest release.", |
||||||
|
VerticalAlignment = VerticalAlignment.Bottom |
||||||
|
}); |
||||||
|
} else if (currentVersion < availableVersion.Version) { |
||||||
|
stackPanel.Children.Add( |
||||||
|
new TextBlock { |
||||||
|
Text = "Version " + availableVersion.Version + " is available.", |
||||||
|
Margin = new Thickness(0,0,8,0), |
||||||
|
VerticalAlignment = VerticalAlignment.Bottom |
||||||
|
}); |
||||||
|
if (availableVersion.DownloadUrl.StartsWith("http://", StringComparison.OrdinalIgnoreCase) |
||||||
|
|| availableVersion.DownloadUrl.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) |
||||||
|
{ |
||||||
|
Button button = new Button(); |
||||||
|
button.Content = "Download"; |
||||||
|
button.Cursor = Cursors.Arrow; |
||||||
|
button.Click += delegate { |
||||||
|
Process.Start(availableVersion.DownloadUrl); |
||||||
|
}; |
||||||
|
stackPanel.Children.Add(button); |
||||||
|
} |
||||||
|
} else { |
||||||
|
stackPanel.Children.Add(new TextBlock { Text = "You are using a nightly builds newer than the latest release." }); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
static Task<AvailableVersionInfo> GetLatestVersion() |
||||||
|
{ |
||||||
|
TaskCompletionSource<AvailableVersionInfo> tcs = new TaskCompletionSource<AvailableVersionInfo>(); |
||||||
|
tcs.SetException(new NotImplementedException()); |
||||||
|
//tcs.SetResult(new AvailableVersionInfo { Version = new Version(0,2,0,37), DownloadUrl = "http://www.ilspy.net/" });
|
||||||
|
return tcs.Task; |
||||||
|
} |
||||||
|
|
||||||
|
sealed class AvailableVersionInfo |
||||||
|
{ |
||||||
|
public Version Version; |
||||||
|
public string DownloadUrl; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 958 B |
@ -1,12 +1,15 @@ |
|||||||
ILSpy is the open-source .NET assembly browser and decompiler. |
ILSpy is the open-source .NET assembly browser and decompiler. |
||||||
|
Website: http://www.ilspy.net/ |
||||||
|
|
||||||
Copyright 2011 AlphaSierraPapa for the SharpDevelop team |
Copyright 2011 AlphaSierraPapa for the SharpDevelop team |
||||||
License: ILSpy is MIT/X11 |
License: ILSpy is MIT/X11 |
||||||
|
|
||||||
Included open-source libraries: |
Included open-source libraries: |
||||||
|
Mono.Cecil: MIT/X11 (thanks to Jb Evain) |
||||||
AvalonEdit: LGPL |
AvalonEdit: LGPL |
||||||
Mono.Cecil: MIT/X11 |
|
||||||
SharpTreeView: LGPL |
SharpTreeView: LGPL |
||||||
|
ICSharpCode.Decompiler: MIT/X11 (developed as part of ILSpy) |
||||||
|
|
||||||
This early version was hastily created by Daniel Grunwald after RedGate announced that Reflector would no longer |
ILSpy Contributors: |
||||||
be available for free. |
Daniel Grunwald |
||||||
|
David Srbecky |
||||||
|
Loading…
Reference in new issue