Browse Source

Add AboutDialog.

pull/1/head
Daniel Grunwald 15 years ago
parent
commit
2b29fb2912
  1. 23
      ILSpy/AboutDialog.xaml
  2. 30
      ILSpy/AboutDialog.xaml.cs
  3. 19
      ILSpy/App.xaml.cs
  4. 5
      ILSpy/ILSpy.csproj
  5. 53
      ILSpy/MainWindow.xaml
  6. 11
      ILSpy/MainWindow.xaml.cs
  7. 2
      ILSpy/Properties/AssemblyInfo.cs

23
ILSpy/AboutDialog.xaml

@ -0,0 +1,23 @@
<Window x:Class="ICSharpCode.ILSpy.AboutDialog"
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" MinWidth="73" HorizontalAlignment="Center">Close</Button>
</StackPanel>
</Window>

30
ILSpy/AboutDialog.xaml.cs

@ -0,0 +1,30 @@
// 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.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>
public partial class AboutDialog : Window
{
public AboutDialog()
{
InitializeComponent();
}
public static string Version {
get { return typeof(AboutDialog).Assembly.GetName().Version.ToString(); }
}
}
}

19
ILSpy/App.xaml.cs

@ -1,8 +1,8 @@
using System; using System;
using System.Diagnostics;
using System.Windows; using System.Windows;
using System.Data; using System.Windows.Documents;
using System.Xml; using System.Windows.Navigation;
using System.Configuration;
namespace ICSharpCode.ILSpy namespace ICSharpCode.ILSpy
{ {
@ -11,5 +11,18 @@ namespace ICSharpCode.ILSpy
/// </summary> /// </summary>
public partial class App : Application public partial class App : Application
{ {
public App()
{
InitializeComponent();
EventManager.RegisterClassHandler(typeof(Window),
Hyperlink.RequestNavigateEvent,
new RequestNavigateEventHandler(Window_RequestNavigate));
}
void Window_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(e.Uri.ToString());
}
} }
} }

5
ILSpy/ILSpy.csproj

@ -60,6 +60,10 @@
<ApplicationDefinition Include="App.xaml" /> <ApplicationDefinition Include="App.xaml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AboutDialog.xaml.cs">
<DependentUpon>AboutDialog.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="App.xaml.cs"> <Compile Include="App.xaml.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<DependentUpon>App.xaml</DependentUpon> <DependentUpon>App.xaml</DependentUpon>
@ -84,6 +88,7 @@
<Compile Include="TypeTreeNode.cs" /> <Compile Include="TypeTreeNode.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="AboutDialog.xaml" />
<Page Include="MainWindow.xaml" /> <Page Include="MainWindow.xaml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

53
ILSpy/MainWindow.xaml

@ -7,9 +7,59 @@
MinWidth="250" MinWidth="250"
MinHeight="200" MinHeight="200"
UseLayoutRounding="True" UseLayoutRounding="True"
Hyperlink.RequestNavigate="Window_RequestNavigate"
TextOptions.TextFormattingMode="Display" TextOptions.TextFormattingMode="Display"
> >
<DockPanel>
<Menu
DockPanel.Dock="Top">
<MenuItem
Header="_File">
<MenuItem
Command="Open">
<MenuItem.Icon>
<Image
Width="16"
Height="16"
Source="Images/Open.png" />
</MenuItem.Icon>
</MenuItem>
<Separator />
<MenuItem
Header="E_xit"
Click="ExitClick" />
</MenuItem>
<MenuItem
Header="_Help">
<MenuItem
Header="_About"
Click="AboutClick" />
</MenuItem>
</Menu>
<ToolBar
DockPanel.Dock="Top">
<ToolBar.Resources>
<!-- Make images transparent if menu command is disabled -->
<Style
TargetType="{x:Type Image}">
<Style.Triggers>
<DataTrigger
Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ButtonBase}, AncestorLevel=1}, Path=IsEnabled}"
Value="False">
<Setter
Property="Opacity"
Value="0.30" />
</DataTrigger>
</Style.Triggers>
</Style>
</ToolBar.Resources>
<Button
Command="Open">
<Image
Width="16"
Height="16"
Source="Images/Open.png" />
</Button>
</ToolBar>
<!-- Main grid separating left pane (treeView) from main pane (textEditor) --> <!-- Main grid separating left pane (treeView) from main pane (textEditor) -->
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -51,4 +101,5 @@
Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}" /> Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}" />
</DockPanel> </DockPanel>
</Grid> </Grid>
</DockPanel>
</Window> </Window>

11
ILSpy/MainWindow.xaml.cs

@ -42,9 +42,16 @@ namespace ICSharpCode.ILSpy
assemblies.Add(new AssemblyTreeNode(asm.Location)); assemblies.Add(new AssemblyTreeNode(asm.Location));
} }
void Window_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e) void ExitClick(object sender, RoutedEventArgs e)
{ {
Process.Start(e.Uri.ToString()); Close();
}
void AboutClick(object sender, RoutedEventArgs e)
{
AboutDialog dlg = new AboutDialog();
dlg.Owner = this;
dlg.ShowDialog();
} }
} }
} }

2
ILSpy/Properties/AssemblyInfo.cs

@ -28,4 +28,4 @@ using System.Runtime.InteropServices;
// //
// You can specify all the values or you can use the default the Revision and // You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below: // Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.*")]

Loading…
Cancel
Save