Browse Source

Add AboutDialog.

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

23
ILSpy/AboutDialog.xaml

@ -0,0 +1,23 @@ @@ -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 @@ @@ -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(); }
}
}
}

8
ILSpy/App.xaml

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
<Application x:Class="ICSharpCode.ILSpy.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style x:Key="DialogWindow" TargetType="{x:Type Window}">
<Style x:Key="DialogWindow" TargetType="{x:Type Window}">
<Setter Property="ShowInTaskbar" Value="False"/>
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>

19
ILSpy/App.xaml.cs

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
using System;
using System.Diagnostics;
using System.Windows;
using System.Data;
using System.Xml;
using System.Configuration;
using System.Windows.Documents;
using System.Windows.Navigation;
namespace ICSharpCode.ILSpy
{
@ -11,5 +11,18 @@ namespace ICSharpCode.ILSpy @@ -11,5 +11,18 @@ namespace ICSharpCode.ILSpy
/// </summary>
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 @@ @@ -60,6 +60,10 @@
<ApplicationDefinition Include="App.xaml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AboutDialog.xaml.cs">
<DependentUpon>AboutDialog.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="App.xaml.cs">
<SubType>Code</SubType>
<DependentUpon>App.xaml</DependentUpon>
@ -84,6 +88,7 @@ @@ -84,6 +88,7 @@
<Compile Include="TypeTreeNode.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="AboutDialog.xaml" />
<Page Include="MainWindow.xaml" />
</ItemGroup>
<ItemGroup>

135
ILSpy/MainWindow.xaml

@ -7,48 +7,99 @@ @@ -7,48 +7,99 @@
MinWidth="250"
MinHeight="200"
UseLayoutRounding="True"
Hyperlink.RequestNavigate="Window_RequestNavigate"
TextOptions.TextFormattingMode="Display"
>
<!-- Main grid separating left pane (treeView) from main pane (textEditor) -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition
MinWidth="100"
Width="250" />
<ColumnDefinition
Width="3" />
<ColumnDefinition
MinWidth="100"
Width="0.514411764705882*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition
Height="*" />
</Grid.RowDefinitions>
<!-- Tree View of assemblies and classes -->
<tv:SharpTreeView
Name="treeView"
ShowRoot="False"
AllowDropOrder="True"
AllowDrop="True" />
<GridSplitter
Grid.ZIndex="1"
Grid.Column="1"
Margin="-2,0"
BorderThickness="2,0"
BorderBrush="Transparent"
HorizontalAlignment="Stretch" />
<!-- DockPanel in right pane -->
<DockPanel
Grid.Column="2">
<ae:TextEditor
SyntaxHighlighting="C#"
FontFamily="Consolas"
FontSize="10pt"
IsReadOnly="True"
Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}"
Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}" />
</DockPanel>
</Grid>
<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) -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition
MinWidth="100"
Width="250" />
<ColumnDefinition
Width="3" />
<ColumnDefinition
MinWidth="100"
Width="0.514411764705882*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition
Height="*" />
</Grid.RowDefinitions>
<!-- Tree View of assemblies and classes -->
<tv:SharpTreeView
Name="treeView"
ShowRoot="False"
AllowDropOrder="True"
AllowDrop="True" />
<GridSplitter
Grid.ZIndex="1"
Grid.Column="1"
Margin="-2,0"
BorderThickness="2,0"
BorderBrush="Transparent"
HorizontalAlignment="Stretch" />
<!-- DockPanel in right pane -->
<DockPanel
Grid.Column="2">
<ae:TextEditor
SyntaxHighlighting="C#"
FontFamily="Consolas"
FontSize="10pt"
IsReadOnly="True"
Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}"
Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}" />
</DockPanel>
</Grid>
</DockPanel>
</Window>

11
ILSpy/MainWindow.xaml.cs

@ -42,9 +42,16 @@ namespace ICSharpCode.ILSpy @@ -42,9 +42,16 @@ namespace ICSharpCode.ILSpy
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; @@ -28,4 +28,4 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.*")]

Loading…
Cancel
Save