Browse Source

Merge pull request #2334 from tom-englert/DarkTheme#665

Dark theme #665
pull/2352/head
Siegfried Pammer 4 years ago committed by GitHub
parent
commit
fe33395e2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ILSpy/AboutPage.cs
  2. 8
      ILSpy/App.xaml
  3. 4
      ILSpy/App.xaml.cs
  4. 6
      ILSpy/Controls/ResourceObjectTable.xaml
  5. 31
      ILSpy/Controls/ResourceStringTable.xaml
  6. 5
      ILSpy/Controls/SearchBoxStyle.xaml
  7. 19
      ILSpy/ILSpy.csproj
  8. 2
      ILSpy/ISmartTextOutput.cs
  9. BIN
      ILSpy/Images/DarkMode.png
  10. 34
      ILSpy/MainWindow.xaml
  11. 8
      ILSpy/MainWindow.xaml.cs
  12. 2
      ILSpy/Metadata/MetadataTableViews.xaml
  13. 2
      ILSpy/Options/DecompilerSettingsPanel.xaml
  14. 2
      ILSpy/Options/DisplaySettingsPanel.xaml
  15. 9
      ILSpy/Properties/Resources.Designer.cs
  16. 3
      ILSpy/Properties/Resources.resx
  17. 2
      ILSpy/Properties/app.config.template
  18. 2
      ILSpy/Search/SearchPane.xaml
  19. 10
      ILSpy/SessionSettings.cs
  20. 1211
      ILSpy/TextView/Asm-Mode-Dark.xshd
  21. 149
      ILSpy/TextView/CSharp-Mode-Dark.xshd
  22. 102
      ILSpy/TextView/DecompilerTextView.cs
  23. 41
      ILSpy/TextView/DecompilerTextView.xaml
  24. 530
      ILSpy/TextView/ILAsm-Mode-Dark.xshd
  25. 63
      ILSpy/TextView/XML-Mode-Dark.xshd
  26. 63
      ILSpy/TextView/XML-Mode.xshd
  27. 50
      ILSpy/ThemeManager.cs
  28. 2
      ILSpy/TreeNodes/AssemblyTreeNode.cs
  29. 17
      ILSpy/TreeNodes/ILSpyTreeNode.cs
  30. 60
      ILSpy/themes/DarkTheme.xaml
  31. 52
      ILSpy/themes/LightTheme.xaml
  32. 11
      ILSpy/themes/ResourceKeys.cs
  33. 6
      ILSpy/themes/generic.xaml
  34. 4
      SharpTreeView/ICSharpCode.TreeView.csproj
  35. 4
      SharpTreeView/SharpTreeNode.cs
  36. 4
      SharpTreeView/SharpTreeView.cs
  37. 35
      SharpTreeView/Themes/Generic.xaml
  38. 2
      packages.props

4
ILSpy/AboutPage.cs

@ -134,7 +134,7 @@ namespace ICSharpCode.ILSpy @@ -134,7 +134,7 @@ namespace ICSharpCode.ILSpy
static void AddUpdateCheckButton(StackPanel stackPanel, DecompilerTextView textView)
{
Button button = new Button();
Button button = ThemeManager.Current.CreateButton();
button.Content = Resources.CheckUpdates;
button.Cursor = Cursors.Arrow;
stackPanel.Children.Add(button);
@ -186,7 +186,7 @@ namespace ICSharpCode.ILSpy @@ -186,7 +186,7 @@ namespace ICSharpCode.ILSpy
});
if (availableVersion.DownloadUrl != null)
{
Button button = new Button();
Button button = ThemeManager.Current.CreateButton();
button.Content = Resources.Download;
button.Cursor = Cursors.Arrow;
button.Click += delegate {

8
ILSpy/App.xaml

@ -1,17 +1,19 @@ @@ -1,17 +1,19 @@
<Application x:Class="ICSharpCode.ILSpy.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:styles="urn:TomsToolbox.Wpf.Styles"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style x:Key="DialogWindow" TargetType="{x:Type Window}">
<Style x:Key="DialogWindow" TargetType="{x:Type Window}" BasedOn="{StaticResource {x:Static styles:ResourceKeys.WindowStyle}}">
<Setter Property="ShowInTaskbar" Value="False"/>
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="TextOptions.TextFormattingMode" Value="Display"/>
</Style>
<Style TargetType="{x:Type Button}">
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Static styles:ResourceKeys.ButtonStyle}}">
<Setter Property="MinWidth" Value="73" />
<Setter Property="Padding" Value="9,1,9,1" />
</Style>
</Application.Resources>
</Application>

4
ILSpy/App.xaml.cs

@ -33,6 +33,8 @@ using ICSharpCode.ILSpy.Options; @@ -33,6 +33,8 @@ using ICSharpCode.ILSpy.Options;
using Microsoft.VisualStudio.Composition;
using TomsToolbox.Wpf.Styles;
namespace ICSharpCode.ILSpy
{
/// <summary>
@ -67,6 +69,8 @@ namespace ICSharpCode.ILSpy @@ -67,6 +69,8 @@ namespace ICSharpCode.ILSpy
}
InitializeComponent();
Resources.RegisterDefaultStyles();
if (!System.Diagnostics.Debugger.IsAttached)
{
AppDomain.CurrentDomain.UnhandledException += ShowErrorBox;

6
ILSpy/Controls/ResourceObjectTable.xaml

@ -13,11 +13,11 @@ @@ -13,11 +13,11 @@
<Grid Margin="5,0,0,0">
<Grid.Resources>
<AlternationConverter x:Key="BackgroundConverter">
<SolidColorBrush Color="White"></SolidColorBrush>
<SolidColorBrush Color="Beige"></SolidColorBrush>
<SolidColorBrush Color="Transparent" />
<SolidColorBrush Color="#CCCC33" Opacity="0.15" />
</AlternationConverter>
<Style x:Key="alternatingWithBinding"
TargetType="{x:Type ListBoxItem}">
TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Setter Property="Background"
Value="{Binding RelativeSource={RelativeSource Self},
Path=(ItemsControl.AlternationIndex),

31
ILSpy/Controls/ResourceStringTable.xaml

@ -13,11 +13,11 @@ @@ -13,11 +13,11 @@
<Grid Margin="5,0,0,0">
<Grid.Resources>
<AlternationConverter x:Key="BackgroundConverter">
<SolidColorBrush Color="White"></SolidColorBrush>
<SolidColorBrush Color="Beige"></SolidColorBrush>
<SolidColorBrush Color="Transparent" />
<SolidColorBrush Color="#CCCC33" Opacity="0.15" />
</AlternationConverter>
<Style x:Key="alternatingWithBinding"
TargetType="{x:Type ListBoxItem}">
TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
<Setter Property="Background"
Value="{Binding RelativeSource={RelativeSource Self},
Path=(ItemsControl.AlternationIndex),
@ -35,27 +35,26 @@ @@ -35,27 +35,26 @@
<ListView Name="resourceListView"
FontFamily="Segoe UI"
FontSize="9pt"
Foreground="Black"
Grid.Row="1"
AlternationCount="2"
ItemContainerStyle="{StaticResource alternatingWithBinding}"
local:SortableGridViewColumn.SortMode="Automatic">
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridView.Columns>
<local:SortableGridViewColumn DisplayMemberBinding="{Binding Key}" SortBy="Key">
<GridViewColumnHeader Content="{x:Static properties:Resources.Name}"
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridView.Columns>
<local:SortableGridViewColumn DisplayMemberBinding="{Binding Key}" SortBy="Key">
<GridViewColumnHeader Content="{x:Static properties:Resources.Name}"
HorizontalContentAlignment="Left"
FontWeight="Bold" />
</local:SortableGridViewColumn>
</local:SortableGridViewColumn>
<local:SortableGridViewColumn DisplayMemberBinding="{Binding Value}" SortBy="Value">
<GridViewColumnHeader Content="{x:Static properties:Resources.Value}"
<GridViewColumnHeader Content="{x:Static properties:Resources.Value}"
HorizontalContentAlignment="Left"
FontWeight="Bold" />
</local:SortableGridViewColumn>
</GridView.Columns>
</GridView>
</ListView.View>
</ListView>
</local:SortableGridViewColumn>
</GridView.Columns>
</GridView>
</ListView.View>
</ListView>
</Grid>
</UserControl>

5
ILSpy/Controls/SearchBoxStyle.xaml

@ -2,10 +2,7 @@ @@ -2,10 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ICSharpCode.ILSpy.Controls">
<Style x:Key="{x:Type local:SearchBox}" TargetType="{x:Type local:SearchBox}">
<Setter Property="Background" Value="White" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Style x:Key="{x:Type local:SearchBox}" TargetType="{x:Type local:SearchBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>

19
ILSpy/ILSpy.csproj

@ -54,13 +54,14 @@ @@ -54,13 +54,14 @@
<PackageReference Include="AvalonEdit" Version="$(AvalonEditVersion)" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemCompilerServicesUnsafeVersion)" />
<PackageReference Include="Dirkster.AvalonDock" Version="4.50.1" />
<PackageReference Include="Dirkster.AvalonDock.Themes.VS2013" Version="4.50.1" />
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="16.9.6-alpha" />
<PackageReference Include="System.Composition" Version="$(SystemCompositionVersion)" />
<PackageReference Include="Mono.Cecil" Version="$(MonoCecilVersion)" />
<PackageReference Include="OSVersionHelper" Version="1.1.24" />
<PackageReference Include="DataGridExtensions" Version="2.5.1" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.31" />
<PackageReference Include="TomsToolbox.Wpf.Styles" Version="2.4.2" />
</ItemGroup>
<ItemGroup>
@ -216,6 +217,8 @@ @@ -216,6 +217,8 @@
<Compile Include="Metadata\MetadataProtocolHandler.cs" />
<Compile Include="Metadata\MetadataTableTreeNode.cs" />
<Compile Include="Metadata\DebugMetadataTreeNode.cs" />
<Compile Include="ThemeManager.cs" />
<Compile Include="themes\ResourceKeys.cs" />
<Compile Include="TreeNodes\PackageFolderTreeNode.cs" />
<Compile Include="ViewModels\LegacyToolPaneModel.cs" />
<Compile Include="ViewModels\ManageAssemblyListsViewModel.cs" />
@ -471,6 +474,9 @@ @@ -471,6 +474,9 @@
<EmbeddedResource Include="TextView\CSharp-Mode.xshd" />
<EmbeddedResource Include="TextView\ILAsm-Mode.xshd" />
<EmbeddedResource Include="TextView\Asm-Mode.xshd" />
<EmbeddedResource Include="TextView\CSharp-Mode-Dark.xshd" />
<EmbeddedResource Include="TextView\ILAsm-Mode-Dark.xshd" />
<EmbeddedResource Include="TextView\Asm-Mode-Dark.xshd" />
<None Include="app.config" />
<None Include="app.manifest" />
<None Include="Properties\app.config.template" />
@ -511,9 +517,11 @@ @@ -511,9 +517,11 @@
<Page Include="Controls\ResourceObjectTable.xaml" />
<Page Include="Controls\ResourceStringTable.xaml" />
<Page Include="Controls\SearchBoxStyle.xaml" />
<Page Include="themes\DarkTheme.xaml" />
<Page Include="Metadata\FlagsFilterControl.xaml" />
<Page Include="Metadata\FlagsTooltip.xaml" />
<Page Include="Metadata\HexFilterControl.xaml" />
<Page Include="themes\LightTheme.xaml" />
<Page Include="Views\CreateListDialog.xaml" />
<Page Include="Views\DebugSteps.xaml" />
<Page Include="Images\Assembly.xaml" />
@ -593,6 +601,9 @@ @@ -593,6 +601,9 @@
<ItemGroup>
<Page Update="@(Page)" SubType="Designer" Generator="MSBuild:Compile" />
<Page Update="themes\DarkTheme.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="Metadata\FlagsFilterControl.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
@ -828,11 +839,16 @@ @@ -828,11 +839,16 @@
<Page Update="Options\DecompilerSettingsPanel.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Update="themes\LightTheme.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<None Include="Search\SearchPane.xaml" />
<None Include="@(Resource)" />
<EmbeddedResource Include="TextView\XML-Mode-Dark.xshd" />
<EmbeddedResource Include="TextView\XML-Mode.xshd" />
</ItemGroup>
<PropertyGroup>
@ -855,6 +871,7 @@ @@ -855,6 +871,7 @@
<ItemGroup>
<Resource Include="Images\NuGet.png" />
<Resource Include="Images\DarkMode.png" />
</ItemGroup>
<Target Name="SortResX" BeforeTargets="BeforeBuild" Inputs="@(SortResXInput)" Outputs="@(SortResXStamp)">

2
ILSpy/ISmartTextOutput.cs

@ -55,7 +55,7 @@ namespace ICSharpCode.ILSpy @@ -55,7 +55,7 @@ namespace ICSharpCode.ILSpy
{
output.AddUIElement(
delegate {
Button button = new Button();
Button button = ThemeManager.Current.CreateButton();
button.Cursor = Cursors.Arrow;
button.Margin = new Thickness(2);
button.Padding = new Thickness(9, 1, 9, 1);

BIN
ILSpy/Images/DarkMode.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

34
ILSpy/MainWindow.xaml

@ -16,8 +16,11 @@ @@ -16,8 +16,11 @@
MinHeight="200"
UseLayoutRounding="True"
TextOptions.TextFormattingMode="Display"
Style="{StaticResource {x:Static styles:ResourceKeys.WindowStyle}}"
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"
xmlns:styles="urn:TomsToolbox.Wpf.Styles"
d:DataContext="{d:DesignInstance local:MainWindowDataContext}"
>
<Window.Resources>
<controls:BoolToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
@ -29,7 +32,7 @@ @@ -29,7 +32,7 @@
ShowRoot="False"
AllowDropOrder="True"
AllowDrop="True"
BorderThickness="0,1,1,1" Visibility="Visible" />
BorderThickness="0" Visibility="Visible" />
<DataTemplate x:Key="AssemblyListPaneTemplate">
<ContentControl Content="{StaticResource AssemblyTreeView}" />
@ -56,6 +59,9 @@ @@ -56,6 +59,9 @@
<DataTemplate x:Key="DefaultContentTemplate">
<ContentPresenter Content="{Binding Content}" />
</DataTemplate>
<styles:InvertGrayEffect x:Key="InvertGrayEffect" />
</Window.Resources>
<Window.CommandBindings>
@ -114,6 +120,20 @@ @@ -114,6 +120,20 @@
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Image}" x:Key="DarkModeAwareImageStyle">
<Style.Triggers>
<DataTrigger
Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ButtonBase}, AncestorLevel=1}, Path=IsEnabled}"
Value="False">
<Setter Property="Opacity" Value="0.30" />
</DataTrigger>
<DataTrigger
Binding="{Binding SessionSettings.IsDarkMode}"
Value="True">
<Setter Property="Effect" Value="{StaticResource InvertGrayEffect}" />
</DataTrigger>
</Style.Triggers>
</Style>
</ToolBar.Resources>
<!-- 'Navigation' toolbar category is inserted here -->
<Separator />
@ -123,17 +143,17 @@ @@ -123,17 +143,17 @@
ItemsSource="{Binding AssemblyListManager.AssemblyLists}" ToolTip="{x:Static properties:Resources.SelectAssemblyListDropdownTooltip}"
SelectedItem="{Binding SessionSettings.ActiveAssemblyList}"/>
<Button Command="{x:Static local:ILSpyCommands.ManageAssemblyListsCommand}" ToolTip="{x:Static properties:Resources.ManageAssemblyLists}">
<Image Width="16" Height="16" Source="{controls:XamlResource Images/AssemblyList}" />
<Image Width="16" Height="16" Source="{controls:XamlResource Images/AssemblyList}" Style="{StaticResource DarkModeAwareImageStyle}"/>
</Button>
<Separator />
<CheckBox IsChecked="{Binding SessionSettings.FilterSettings.ApiVisPublicOnly}" ToolTip="{x:Static properties:Resources.ShowPublicOnlyTypesMembers}">
<Image Width="16" Height="16" Source="{controls:XamlResource Images/ShowPublicOnly}" />
<Image Width="16" Height="16" Source="{controls:XamlResource Images/ShowPublicOnly}" Style="{StaticResource DarkModeAwareImageStyle}"/>
</CheckBox>
<CheckBox IsChecked="{Binding SessionSettings.FilterSettings.ApiVisPublicAndInternal}" ToolTip="{x:Static properties:Resources.ShowInternalTypesMembers}">
<Image Width="16" Height="16" Source="{controls:XamlResource Images/ShowPrivateInternal}" />
<Image Width="16" Height="16" Source="{controls:XamlResource Images/ShowPrivateInternal}" Style="{StaticResource DarkModeAwareImageStyle}"/>
</CheckBox>
<CheckBox IsChecked="{Binding SessionSettings.FilterSettings.ApiVisAll}" ToolTip="{x:Static properties:Resources.ShowAllTypesAndMembers}">
<Image Width="16" Height="16" Source="{controls:XamlResource Images/ShowAll}" />
<Image Width="16" Height="16" Source="{controls:XamlResource Images/ShowAll}" Style="{StaticResource DarkModeAwareImageStyle}"/>
</CheckBox>
<Separator />
<ComboBox Name="languageComboBox" DisplayMemberPath="Name" Width="100" MaxDropDownHeight="Auto"
@ -145,6 +165,10 @@ @@ -145,6 +165,10 @@
IsEnabled="{Binding ActiveTabPage.SupportsLanguageSwitching, Source={x:Static docking:DockWorkspace.Instance}}"
ItemsSource="{Binding SelectedItem.LanguageVersions, ElementName=languageComboBox, UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding SessionSettings.FilterSettings.LanguageVersion, UpdateSourceTrigger=PropertyChanged}"/>
<Separator />
<CheckBox IsChecked="{Binding SessionSettings.IsDarkMode}" ToolTip="{x:Static properties:Resources.DarkMode}">
<Image Source="Images/DarkMode.png" Stretch="None" Style="{StaticResource DarkModeAwareImageStyle}"/>
</CheckBox>
</ToolBar>
<Border DockPanel.Dock="Top" BorderBrush="Black" BorderThickness="1" Name="updatePanel" Visibility="Collapsed">
<DockPanel KeyboardNavigation.TabNavigation="Contained">

8
ILSpy/MainWindow.xaml.cs

@ -142,6 +142,13 @@ namespace ICSharpCode.ILSpy @@ -142,6 +142,13 @@ namespace ICSharpCode.ILSpy
{
ShowAssemblyList(sessionSettings.ActiveAssemblyList);
}
if (e.PropertyName == nameof(SessionSettings.IsDarkMode))
{
// update syntax highlighting and force reload (AvalonEdit does not automatically refresh on highlighting change)
DecompilerTextView.RegisterHighlighting();
DecompileSelectedNodes(DockWorkspace.Instance.ActiveTabPage.GetState() as DecompilerTextViewState);
}
}
void SetWindowBounds(Rect bounds)
@ -191,6 +198,7 @@ namespace ICSharpCode.ILSpy @@ -191,6 +198,7 @@ namespace ICSharpCode.ILSpy
Button MakeToolbarItem(Lazy<ICommand, IToolbarCommandMetadata> command)
{
return new Button {
Style = ThemeManager.Current.CreateToolBarButtonStyle(),
Command = CommandWrapper.Unwrap(command.Value),
ToolTip = Properties.Resources.ResourceManager.GetString(command.Metadata.ToolTip),
Tag = command.Metadata.Tag,

2
ILSpy/Metadata/MetadataTableViews.xaml

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
xmlns:srm="clr-namespace:System.Reflection;assembly=System.Reflection.Metadata"
xmlns:dgx="urn:tom-englert.de/DataGridExtensions">
<Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}">
<Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="2" />
<Setter Property="VerticalContentAlignment" Value="Center" />

2
ILSpy/Options/DecompilerSettingsPanel.xaml

@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Style TargetType="{x:Type GroupItem}" BasedOn="{StaticResource {x:Type GroupItem}}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>

2
ILSpy/Options/DisplaySettingsPanel.xaml

@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
<ComboBoxItem>23</ComboBoxItem>
<ComboBoxItem>24</ComboBoxItem>
</ComboBox>
<Border Grid.Row="1" Grid.ColumnSpan="4" BorderBrush="Black" BorderThickness="1" Background="White" Margin="3,5">
<Border Grid.Row="1" Grid.ColumnSpan="4" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" BorderThickness="1" Margin="3,5">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="AaBbCcXxYyZz" FontFamily="{Binding SelectedFont}" FontSize="{Binding SelectedFontSize}" />
</Border>
</Grid>

9
ILSpy/Properties/Resources.Designer.cs generated

@ -540,6 +540,15 @@ namespace ICSharpCode.ILSpy.Properties { @@ -540,6 +540,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Dark Mode.
/// </summary>
public static string DarkMode {
get {
return ResourceManager.GetString("DarkMode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to DEBUG -- Decompile All.
/// </summary>

3
ILSpy/Properties/Resources.resx

@ -219,6 +219,9 @@ Are you sure you want to continue?</value> @@ -219,6 +219,9 @@ Are you sure you want to continue?</value>
<data name="DEBUGDumpPDBAsXML" xml:space="preserve">
<value>DEBUG -- Dump PDB as XML</value>
</data>
<data name="DarkMode" xml:space="preserve">
<value>Dark Mode</value>
</data>
<data name="DebugSteps" xml:space="preserve">
<value>Debug Steps</value>
</data>

2
ILSpy/Properties/app.config.template

@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.AvalonEdit" publicKeyToken="9cc39be672370310" culture="neutral"/>
<bindingRedirect oldVersion="4.1.0.0-99.9.9.9" newVersion="6.1.0.12"/>
<bindingRedirect oldVersion="4.1.0.0-99.9.9.9" newVersion="6.1.1.20"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.Decompiler" publicKeyToken="d4bfe873e7598c49" culture="neutral"/>

2
ILSpy/Search/SearchPane.xaml

@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
<RowDefinition />
</Grid.RowDefinitions>
<Border BorderBrush="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Margin="0">
<Grid Height="23">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />

10
ILSpy/SessionSettings.cs

@ -61,6 +61,7 @@ namespace ICSharpCode.ILSpy @@ -61,6 +61,7 @@ namespace ICSharpCode.ILSpy
this.TopPaneSplitterPosition = FromString((string)doc.Element("TopPaneSplitterPosition"), 0.3);
this.BottomPaneSplitterPosition = FromString((string)doc.Element("BottomPaneSplitterPosition"), 0.3);
this.SelectedSearchMode = FromString((string)doc.Element("SelectedSearchMode"), SearchMode.TypeAndMember);
this.IsDarkMode = FromString((string)doc.Element(nameof(IsDarkMode)), false);
this.DockLayout = new DockLayoutSettings(doc.Element("DockLayout"));
}
@ -75,6 +76,14 @@ namespace ICSharpCode.ILSpy @@ -75,6 +76,14 @@ namespace ICSharpCode.ILSpy
public FilterSettings FilterSettings { get; private set; }
public SearchMode SelectedSearchMode { get; set; }
public bool IsDarkMode {
get => ThemeManager.Current.IsDarkMode;
set {
ThemeManager.Current.IsDarkMode = value;
OnPropertyChanged();
}
}
public string[] ActiveTreeViewPath;
public string ActiveAutoLoadedAssembly;
@ -122,6 +131,7 @@ namespace ICSharpCode.ILSpy @@ -122,6 +131,7 @@ namespace ICSharpCode.ILSpy
doc.Add(new XElement("TopPaneSplitterPosition", ToString(this.TopPaneSplitterPosition)));
doc.Add(new XElement("BottomPaneSplitterPosition", ToString(this.BottomPaneSplitterPosition)));
doc.Add(new XElement("SelectedSearchMode", ToString(this.SelectedSearchMode)));
doc.Add(new XElement(nameof(IsDarkMode), ToString(this.IsDarkMode)));
var dockLayoutElement = new XElement("DockLayout");
if (DockLayout.Valid)

1211
ILSpy/TextView/Asm-Mode-Dark.xshd

File diff suppressed because it is too large Load Diff

149
ILSpy/TextView/CSharp-Mode-Dark.xshd

@ -0,0 +1,149 @@ @@ -0,0 +1,149 @@
<?xml version="1.0"?>
<SyntaxDefinition name="C#" extensions=".cs" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<!-- This is a variant of the AvalonEdit C# highlighting that has several constructs disabled.
The disabled constructs (e.g. contextual keywords) are highlighted using the CSharpLanguage.HighlightingTokenWriter instead.
-->
<!-- The named colors 'Comment' and 'String' are used in SharpDevelop to detect if a line is inside a multiline string/comment -->
<Color name="Comment" foreground="#FF57A64A" exampleText="// comment" />
<Color name="String" foreground="#FFD69D85" exampleText="string text = &quot;Hello, World!&quot;"/>
<Color name="StringInterpolation" foreground="#FFffd68f" exampleText="string text = $&quot;Hello, {name}!&quot;"/>
<Color name="Char" foreground="#FFD69D85" exampleText="char linefeed = '\n';"/>
<Color name="Preprocessor" foreground="#FF9B9B9B" exampleText="#region Title"/>
<Color name="Punctuation" foreground="White" exampleText="a(b.c);"/>
<Color name="ValueTypeKeywords" foreground="#FF00A0FF" exampleText="bool b = true;"/>
<Color name="ReferenceTypeKeywords" foreground="#FF559CD6" exampleText="object o;"/>
<Color name="NumberLiteral" foreground="#FFb5cea8" exampleText="3.1415f"/>
<Color name="ThisOrBaseReference" foreground="#FF3a6a9b" exampleText="this.Do(); base.Do();"/>
<Color name="NullOrValueKeywords" foreground="#FF559CD6" exampleText="if (value == null)"/>
<Color name="Keywords" foreground="#FFd8a0df" exampleText="if (a) {} else {}"/>
<Color name="GotoKeywords" foreground="#FFd8a0df" exampleText="continue; return null;"/>
<Color name="QueryKeywords" foreground="#FFd8a0df" exampleText="var a = from x in y select z;"/>
<Color name="ExceptionKeywords" foreground="#FFd8a0df" exampleText="try {} catch {} finally {}"/>
<Color name="CheckedKeyword" foreground="#FF559CD6" exampleText="checked {}"/>
<Color name="UnsafeKeywords" foreground="#FF559CD6" exampleText="unsafe { fixed (..) {} }"/>
<Color name="OperatorKeywords" foreground="#FFD69D85" exampleText="public static implicit operator..."/>
<Color name="ParameterModifiers" foreground="#FF559CD6" exampleText="(ref int a, params int[] b)"/>
<Color name="Modifiers" foreground="#FF559CD6" exampleText="static readonly int a;"/>
<Color name="Visibility" foreground="#FF559CD6" exampleText="public override void ToString();"/>
<Color name="NamespaceKeywords" foreground="#FF559CD6" exampleText="namespace A.B { using System; }"/>
<Color name="GetSetAddRemove" foreground="#FF559CD6" exampleText="int Prop { get; set; }"/>
<Color name="TrueFalse" foreground="#FF00A0FF" exampleText="b = false; a = true;"/>
<Color name="TypeKeywords" foreground="#FF559CD6" exampleText="if (x is int) { a = x as int; type = typeof(int); size = sizeof(int); c = new object(); }"/>
<Color name="AttributeKeywords" foreground="#FFD69D85" exampleText="[assembly: AssemblyVersion(&quot;1.0.0.*&quot;)]" />
<!-- Colors used for semantic highlighting -->
<Color name="ReferenceTypes" foreground="#569CD6" exampleText="System.#{#Uri#}# uri;"/>
<Color name="InterfaceTypes" foreground="#569CD6" exampleText="System.#{#IDisposable#}# obj;"/>
<Color name="TypeParameters" foreground="#569CD6" exampleText="class MyList&lt;#{#T#}#&gt; { }"/>
<Color name="DelegateTypes" foreground="#569CD6" exampleText="System.#{#Action#}#; action;"/>
<Color name="ValueTypes" fontWeight="bold" foreground="#569CD6" exampleText="System.#{#DateTime#}# date;"/>
<Color name="EnumTypes" fontWeight="bold" foreground="#569CD6" exampleText="System.#{#ConsoleKey#}# key;"/>
<Color name="MethodCall" foreground="#FFdcdcaa" fontWeight="bold" exampleText="o.#{#ToString#}#();"/>
<Color name="FieldAccess" fontStyle="italic" exampleText="return this.#{#name#}#;"/>
<Color name="InactiveCode" foreground="Gray" exampleText="#{#Deactivated by #if#}#"/>
<Color name="SemanticError" foreground="DarkRed" exampleText="o.#{#MissingMethod#}#()"/>
<Property name="DocCommentMarker" value="///" />
<RuleSet name="CommentMarkerSet">
<Keywords fontWeight="bold" foreground="Red">
<Word>TODO</Word>
<Word>FIXME</Word>
</Keywords>
<Keywords fontWeight="bold" foreground="#E0E000">
<Word>HACK</Word>
<Word>UNDONE</Word>
</Keywords>
</RuleSet>
<!-- This is the main ruleset. -->
<RuleSet>
<Span color="Preprocessor">
<Begin>\#</Begin>
<RuleSet name="PreprocessorSet">
<Span> <!-- preprocessor directives that allow comments -->
<Begin fontWeight="bold">
(define|undef|if|elif|else|endif|line)\b
</Begin>
<RuleSet>
<Span color="Comment" ruleSet="CommentMarkerSet">
<Begin>//</Begin>
</Span>
</RuleSet>
</Span>
<Span> <!-- preprocessor directives that don't allow comments -->
<Begin fontWeight="bold">
(region|endregion|error|warning|pragma)\b
</Begin>
</Span>
</RuleSet>
</Span>
<Span color="Comment">
<Begin color="XmlDoc/DocComment">///(?!/)</Begin>
<RuleSet>
<Import ruleSet="XmlDoc/DocCommentSet"/>
<Import ruleSet="CommentMarkerSet"/>
</RuleSet>
</Span>
<Span color="Comment" ruleSet="CommentMarkerSet">
<Begin>//</Begin>
</Span>
<Span color="Comment" ruleSet="CommentMarkerSet" multiline="true">
<Begin>/\*</Begin>
<End>\*/</End>
</Span>
<Span color="String">
<Begin>"</Begin>
<End>"</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin="\\" end="."/>
</RuleSet>
</Span>
<Span color="Char">
<Begin>'</Begin>
<End>'</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin="\\" end="."/>
</RuleSet>
</Span>
<Span color="String" multiline="true">
<Begin color="String">@"</Begin>
<End>"</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin='""' end=""/>
</RuleSet>
</Span>
<Span color="String">
<Begin>\$"</Begin>
<End>"</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin="\\" end="."/>
<Span begin="\{\{" end=""/>
<!-- string interpolation -->
<Span begin="{" end="}" color="StringInterpolation" ruleSet=""/>
</RuleSet>
</Span>
<!-- Digits -->
<Rule color="NumberLiteral">
\b0[xX][0-9a-fA-F]+ # hex number
|
( \b\d+(\.[0-9]+)? #number with optional floating point
| \.[0-9]+ #or just starting with floating point
)
([eE][+-]?[0-9]+)? # optional exponent
</Rule>
</RuleSet>
</SyntaxDefinition>

102
ILSpy/TextView/DecompilerTextView.cs

@ -59,6 +59,10 @@ using ICSharpCode.ILSpy.ViewModels; @@ -59,6 +59,10 @@ using ICSharpCode.ILSpy.ViewModels;
using Microsoft.Win32;
using TomsToolbox.Wpf;
using ResourceKeys = ICSharpCode.ILSpy.themes.ResourceKeys;
namespace ICSharpCode.ILSpy.TextView
{
/// <summary>
@ -87,41 +91,7 @@ namespace ICSharpCode.ILSpy.TextView @@ -87,41 +91,7 @@ namespace ICSharpCode.ILSpy.TextView
#region Constructor
public DecompilerTextView()
{
HighlightingManager.Instance.RegisterHighlighting(
"ILAsm", new string[] { ".il" },
delegate {
using (Stream s = typeof(DecompilerTextView).Assembly.GetManifestResourceStream(typeof(DecompilerTextView), "ILAsm-Mode.xshd"))
{
using (XmlTextReader reader = new XmlTextReader(s))
{
return HighlightingLoader.Load(reader, HighlightingManager.Instance);
}
}
});
HighlightingManager.Instance.RegisterHighlighting(
"C#", new string[] { ".cs" },
delegate {
using (Stream s = typeof(DecompilerTextView).Assembly.GetManifestResourceStream(typeof(DecompilerTextView), "CSharp-Mode.xshd"))
{
using (XmlTextReader reader = new XmlTextReader(s))
{
return HighlightingLoader.Load(reader, HighlightingManager.Instance);
}
}
});
HighlightingManager.Instance.RegisterHighlighting(
"Asm", new string[] { ".s", ".asm" },
delegate {
using (Stream s = typeof(DecompilerTextView).Assembly.GetManifestResourceStream(typeof(DecompilerTextView), "Asm-Mode.xshd"))
{
using (XmlTextReader reader = new XmlTextReader(s))
{
return HighlightingLoader.Load(reader, HighlightingManager.Instance);
}
}
});
RegisterHighlighting();
InitializeComponent();
@ -153,8 +123,16 @@ namespace ICSharpCode.ILSpy.TextView @@ -153,8 +123,16 @@ namespace ICSharpCode.ILSpy.TextView
DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged += CurrentDisplaySettings_PropertyChanged;
// SearchPanel
SearchPanel.Install(textEditor.TextArea)
.RegisterCommands(Application.Current.MainWindow.CommandBindings);
SearchPanel searchPanel = SearchPanel.Install(textEditor.TextArea);
searchPanel.RegisterCommands(Application.Current.MainWindow.CommandBindings);
searchPanel.Loaded += (_, _) => {
// HACK: fix the hardcoded but misaligned margin of the search text box.
var textBox = searchPanel.VisualDescendants().OfType<TextBox>().FirstOrDefault();
if (textBox != null)
{
textBox.Margin = new Thickness(3);
}
};
ShowLineMargin();
SetHighlightCurrentLine();
@ -165,6 +143,8 @@ namespace ICSharpCode.ILSpy.TextView @@ -165,6 +143,8 @@ namespace ICSharpCode.ILSpy.TextView
ContextMenuProvider.Add(this);
textEditor.TextArea.TextView.SetResourceReference(ICSharpCode.AvalonEdit.Rendering.TextView.LinkTextForegroundBrushProperty, ResourceKeys.LinkTextForegroundBrush);
this.DataContextChanged += DecompilerTextView_DataContextChanged;
}
@ -494,14 +474,15 @@ namespace ICSharpCode.ILSpy.TextView @@ -494,14 +474,15 @@ namespace ICSharpCode.ILSpy.TextView
};
viewer.Document = document;
Border border = new Border {
Background = SystemColors.ControlBrush,
BorderBrush = SystemColors.ControlDarkBrush,
BorderThickness = new Thickness(1),
MaxHeight = 400,
Child = viewer
};
border.SetResourceReference(Border.BackgroundProperty, SystemColors.ControlBrushKey);
border.SetResourceReference(Border.BorderBrushProperty, SystemColors.ControlDarkBrushKey);
this.Child = border;
viewer.Foreground = SystemColors.InfoTextBrush;
viewer.SetResourceReference(ForegroundProperty, SystemColors.InfoTextBrushKey);
document.TextAlignment = TextAlignment.Left;
document.FontSize = fontSize;
document.FontFamily = SystemFonts.SmallCaptionFontFamily;
@ -960,8 +941,9 @@ namespace ICSharpCode.ILSpy.TextView @@ -960,8 +941,9 @@ namespace ICSharpCode.ILSpy.TextView
{
if (reference.Equals(r.Reference))
{
var mark = textMarkerService.Create(r.StartOffset, r.Length);
mark.BackgroundColor = r.IsDefinition ? Colors.LightSeaGreen : Colors.GreenYellow;
mark.BackgroundColor = (Color)(r.IsDefinition ? FindResource(ResourceKeys.TextMarkerDefinitionBackgroundColor) : FindResource(ResourceKeys.TextMarkerBackgroundColor));
localReferenceMarks.Add(mark);
}
}
@ -1190,6 +1172,15 @@ namespace ICSharpCode.ILSpy.TextView @@ -1190,6 +1172,15 @@ namespace ICSharpCode.ILSpy.TextView
ViewState IHaveState.GetState() => GetState();
public static void RegisterHighlighting()
{
HighlightingManager.Instance.RegisterHighlighting("ILAsm", new[] { ".il" }, "ILAsm-Mode");
HighlightingManager.Instance.RegisterHighlighting("C#", new[] { ".cs" }, "CSharp-Mode");
HighlightingManager.Instance.RegisterHighlighting("Asm", new[] { ".s", ".asm" }, "Asm-Mode");
HighlightingManager.Instance.RegisterHighlighting("xml", new[] { ".xml", ".baml" }, "XML-Mode");
}
public void Dispose()
{
DisplaySettingsPanel.CurrentDisplaySettings.PropertyChanged -= CurrentDisplaySettings_PropertyChanged;
@ -1274,4 +1265,33 @@ namespace ICSharpCode.ILSpy.TextView @@ -1274,4 +1265,33 @@ namespace ICSharpCode.ILSpy.TextView
return false;
}
}
static class ExtensionMethods
{
public static void RegisterHighlighting(
this HighlightingManager manager,
string name,
string[] extensions,
string resourceName)
{
if (ThemeManager.Current.IsDarkMode)
{
resourceName += "-Dark";
}
resourceName += ".xshd";
manager.RegisterHighlighting(
name, extensions,
delegate {
using (Stream s = typeof(DecompilerTextView).Assembly.GetManifestResourceStream(typeof(DecompilerTextView), resourceName))
{
using (XmlTextReader reader = new XmlTextReader(s))
{
return HighlightingLoader.Load(reader, manager);
}
}
});
}
}
}

41
ILSpy/TextView/DecompilerTextView.xaml

@ -2,22 +2,53 @@ @@ -2,22 +2,53 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
xmlns:ae="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit">
xmlns:ae="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
xmlns:folding="clr-namespace:ICSharpCode.AvalonEdit.Folding;assembly=ICSharpCode.AvalonEdit"
xmlns:styles="urn:TomsToolbox.Wpf.Styles">
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="boolToVisibility" />
<SolidColorBrush x:Key="waitAdornerBackgoundBrush" Color="{DynamicResource {x:Static SystemColors.WindowColorKey}}" Opacity=".75"/>
</UserControl.Resources>
<Grid>
<Border BorderThickness="1,1,0,1" BorderBrush="#FF828790">
<Border BorderThickness="1,1,0,1" BorderBrush="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}">
<Grid>
<ae:TextEditor Name="textEditor" AutomationProperties.Name="Decompilation" FontFamily="Consolas" FontSize="10pt" IsReadOnly="True"
Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}"
Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}">
Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}"
folding:FoldingMargin.FoldingMarkerBackgroundBrush="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
folding:FoldingMargin.SelectedFoldingMarkerBackgroundBrush="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
folding:FoldingMargin.FoldingMarkerBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"
folding:FoldingMargin.SelectedFoldingMarkerBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
>
<ae:TextEditor.Resources>
<!-- prevent App-wide button style from applying to the buttons in the search box -->
<Style TargetType="{x:Type Button}" />
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static styles:ResourceKeys.BorderBrush}}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border BorderThickness="1"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
</Trigger>
</Style.Triggers>
</Style>
</ae:TextEditor.Resources>
</ae:TextEditor>
<Border Name="waitAdorner" Background="#C0FFFFFF" Visibility="Collapsed">
<Border Name="waitAdorner" Background="{StaticResource waitAdornerBackgoundBrush}" Visibility="Collapsed">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock FontSize="14pt" Text="{x:Static properties:Resources.Decompiling}"/>
<ProgressBar Name="progressBar" Height="16" Margin="0, 4" />

530
ILSpy/TextView/ILAsm-Mode-Dark.xshd

@ -0,0 +1,530 @@ @@ -0,0 +1,530 @@
<SyntaxDefinition name="ILAsm" extensions=".il" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Comment" foreground="#FF57A64A" exampleText="// comment" />
<Color name="String" foreground="#FFD69D85" exampleText="&quot;Hello, World!&quot;" />
<Color name="Instructions" foreground="#FFD69D85" exampleText="nop;" />
<Color name="Keywords" foreground="#FFD69D85" fontWeight="bold" exampleText="true" />
<Color name="Directives" foreground="#FF57A64A" fontWeight="bold" exampleText=".class" />
<Color name="Security" foreground="#FF559CD6" exampleText="request" />
<RuleSet ignoreCase="false">
<Keywords color="Instructions">
<Word>nop</Word>
<Word>break</Word>
<Word>ldarg.0</Word>
<Word>ldarg.1</Word>
<Word>ldarg.2</Word>
<Word>ldarg.3</Word>
<Word>ldloc.0</Word>
<Word>ldloc.1</Word>
<Word>ldloc.2</Word>
<Word>ldloc.3</Word>
<Word>stloc.0</Word>
<Word>stloc.1</Word>
<Word>stloc.2</Word>
<Word>stloc.3</Word>
<Word>ldarg.s</Word>
<Word>ldarga.s</Word>
<Word>starg.s</Word>
<Word>ldloc.s</Word>
<Word>ldloca.s</Word>
<Word>stloc.s</Word>
<Word>ldnull</Word>
<Word>ldc.i4.m1</Word>
<Word>ldc.i4.0</Word>
<Word>ldc.i4.1</Word>
<Word>ldc.i4.2</Word>
<Word>ldc.i4.3</Word>
<Word>ldc.i4.4</Word>
<Word>ldc.i4.5</Word>
<Word>ldc.i4.6</Word>
<Word>ldc.i4.7</Word>
<Word>ldc.i4.8</Word>
<Word>ldc.i4.s</Word>
<Word>ldc.i4</Word>
<Word>ldc.i8</Word>
<Word>ldc.r4</Word>
<Word>ldc.r8</Word>
<Word>dup</Word>
<Word>pop</Word>
<Word>jmp</Word>
<Word>call</Word>
<Word>calli</Word>
<Word>ret</Word>
<Word>br.s</Word>
<Word>brfalse.s</Word>
<Word>brtrue.s</Word>
<Word>beq.s</Word>
<Word>bge.s</Word>
<Word>bgt.s</Word>
<Word>ble.s</Word>
<Word>blt.s</Word>
<Word>bne.un.s</Word>
<Word>bge.un.s</Word>
<Word>bgt.un.s</Word>
<Word>ble.un.s</Word>
<Word>blt.un.s</Word>
<Word>br</Word>
<Word>brfalse</Word>
<Word>brtrue</Word>
<Word>beq</Word>
<Word>bge</Word>
<Word>bgt</Word>
<Word>ble</Word>
<Word>blt</Word>
<Word>bne.un</Word>
<Word>bge.un</Word>
<Word>bgt.un</Word>
<Word>ble.un</Word>
<Word>blt.un</Word>
<Word>switch</Word>
<Word>ldind.i1</Word>
<Word>ldind.u1</Word>
<Word>ldind.i2</Word>
<Word>ldind.u2</Word>
<Word>ldind.i4</Word>
<Word>ldind.u4</Word>
<Word>ldind.i8</Word>
<Word>ldind.i</Word>
<Word>ldind.r4</Word>
<Word>ldind.r8</Word>
<Word>ldind.ref</Word>
<Word>stind.ref</Word>
<Word>stind.i1</Word>
<Word>stind.i2</Word>
<Word>stind.i4</Word>
<Word>stind.i8</Word>
<Word>stind.r4</Word>
<Word>stind.r8</Word>
<Word>add</Word>
<Word>sub</Word>
<Word>mul</Word>
<Word>div</Word>
<Word>div.un</Word>
<Word>rem</Word>
<Word>rem.un</Word>
<Word>and</Word>
<Word>or</Word>
<Word>xor</Word>
<Word>shl</Word>
<Word>shr</Word>
<Word>shr.un</Word>
<Word>neg</Word>
<Word>not</Word>
<Word>conv.i1</Word>
<Word>conv.i2</Word>
<Word>conv.i4</Word>
<Word>conv.i8</Word>
<Word>conv.r4</Word>
<Word>conv.r8</Word>
<Word>conv.u4</Word>
<Word>conv.u8</Word>
<Word>callvirt</Word>
<Word>cpobj</Word>
<Word>ldobj</Word>
<Word>ldstr</Word>
<Word>newobj</Word>
<Word>castclass</Word>
<Word>isinst</Word>
<Word>conv.r.un</Word>
<Word>unbox</Word>
<Word>throw</Word>
<Word>ldfld</Word>
<Word>ldflda</Word>
<Word>stfld</Word>
<Word>ldsfld</Word>
<Word>ldsflda</Word>
<Word>stsfld</Word>
<Word>stobj</Word>
<Word>conv.ovf.i1.un</Word>
<Word>conv.ovf.i2.un</Word>
<Word>conv.ovf.i4.un</Word>
<Word>conv.ovf.i8.un</Word>
<Word>conv.ovf.u1.un</Word>
<Word>conv.ovf.u2.un</Word>
<Word>conv.ovf.u4.un</Word>
<Word>conv.ovf.u8.un</Word>
<Word>conv.ovf.i.un</Word>
<Word>conv.ovf.u.un</Word>
<Word>box</Word>
<Word>newarr</Word>
<Word>ldlen</Word>
<Word>ldelema</Word>
<Word>ldelem</Word>
<Word>ldelem.i1</Word>
<Word>ldelem.u1</Word>
<Word>ldelem.i2</Word>
<Word>ldelem.u2</Word>
<Word>ldelem.i4</Word>
<Word>ldelem.u4</Word>
<Word>ldelem.i8</Word>
<Word>ldelem.i</Word>
<Word>ldelem.r4</Word>
<Word>ldelem.r8</Word>
<Word>ldelem.ref</Word>
<Word>stelem</Word>
<Word>stelem.i</Word>
<Word>stelem.i1</Word>
<Word>stelem.i2</Word>
<Word>stelem.i4</Word>
<Word>stelem.i8</Word>
<Word>stelem.r4</Word>
<Word>stelem.r8</Word>
<Word>stelem.ref</Word>
<Word>conv.ovf.i1</Word>
<Word>conv.ovf.u1</Word>
<Word>conv.ovf.i2</Word>
<Word>conv.ovf.u2</Word>
<Word>conv.ovf.i4</Word>
<Word>conv.ovf.u4</Word>
<Word>conv.ovf.i8</Word>
<Word>conv.ovf.u8</Word>
<Word>refanyval</Word>
<Word>ckfinite</Word>
<Word>mkrefany</Word>
<Word>ldtoken</Word>
<Word>conv.u2</Word>
<Word>conv.u1</Word>
<Word>conv.i</Word>
<Word>conv.ovf.i</Word>
<Word>conv.ovf.u</Word>
<Word>add.ovf</Word>
<Word>add.ovf.un</Word>
<Word>mul.ovf</Word>
<Word>mul.ovf.un</Word>
<Word>sub.ovf</Word>
<Word>sub.ovf.un</Word>
<Word>endfinally</Word>
<Word>leave</Word>
<Word>leave.s</Word>
<Word>stind.i</Word>
<Word>conv.u</Word>
<Word>prefix7</Word>
<Word>prefix6</Word>
<Word>prefix5</Word>
<Word>prefix4</Word>
<Word>prefix3</Word>
<Word>prefix2</Word>
<Word>prefix1</Word>
<Word>prefixref</Word>
<Word>arglist</Word>
<Word>ceq</Word>
<Word>cgt</Word>
<Word>cgt.un</Word>
<Word>clt</Word>
<Word>clt.un</Word>
<Word>ldftn</Word>
<Word>ldvirtftn</Word>
<Word>ldarg</Word>
<Word>ldarga</Word>
<Word>starg</Word>
<Word>ldloc</Word>
<Word>ldloca</Word>
<Word>stloc</Word>
<Word>localloc</Word>
<Word>endfilter</Word>
<Word>unaligned.</Word>
<Word>volatile.</Word>
<Word>tail.</Word>
<Word>initobj</Word>
<Word>cpblk</Word>
<Word>initblk</Word>
<Word>rethrow</Word>
<Word>sizeof</Word>
<Word>refanytype</Word>
<Word>illegal</Word>
<Word>endmac</Word>
<Word>brnull</Word>
<Word>brnull.s</Word>
<Word>brzero</Word>
<Word>brzero.s</Word>
<Word>brinst</Word>
<Word>brinst.s</Word>
<Word>ldind.u8</Word>
<Word>ldelem.u8</Word>
<Word>ldc.i4.M1</Word>
<Word>endfault</Word>
</Keywords>
<Keywords color="Keywords">
<Word>void</Word>
<Word>bool</Word>
<Word>char</Word>
<Word>wchar</Word>
<Word>int</Word>
<Word>int8</Word>
<Word>int16</Word>
<Word>int32</Word>
<Word>int64</Word>
<Word>uint8</Word>
<Word>uint16</Word>
<Word>uint32</Word>
<Word>uint64</Word>
<Word>float</Word>
<Word>float32</Word>
<Word>float64</Word>
<Word>refany</Word>
<Word>typedref</Word>
<Word>object</Word>
<Word>string</Word>
<Word>native</Word>
<Word>unsigned</Word>
<Word>value</Word>
<Word>valuetype</Word>
<Word>class</Word>
<Word>const</Word>
<Word>vararg</Word>
<Word>default</Word>
<Word>stdcall</Word>
<Word>thiscall</Word>
<Word>fastcall</Word>
<Word>unmanaged</Word>
<Word>not_in_gc_heap</Word>
<Word>beforefieldinit</Word>
<Word>instance</Word>
<Word>filter</Word>
<Word>catch</Word>
<Word>static</Word>
<Word>public</Word>
<Word>private</Word>
<Word>synchronized</Word>
<Word>interface</Word>
<Word>extends</Word>
<Word>implements</Word>
<Word>handler</Word>
<Word>finally</Word>
<Word>fault</Word>
<Word>to</Word>
<Word>abstract</Word>
<Word>auto</Word>
<Word>sequential</Word>
<Word>explicit</Word>
<Word>wrapper</Word>
<Word>ansi</Word>
<Word>unicode</Word>
<Word>autochar</Word>
<Word>import</Word>
<Word>enum</Word>
<Word>virtual</Word>
<Word>notremotable</Word>
<Word>special</Word>
<Word>il</Word>
<Word>cil</Word>
<Word>optil</Word>
<Word>managed</Word>
<Word>preservesig</Word>
<Word>runtime</Word>
<Word>method</Word>
<Word>field</Word>
<Word>bytearray</Word>
<Word>final</Word>
<Word>sealed</Word>
<Word>specialname</Word>
<Word>family</Word>
<Word>assembly</Word>
<Word>famandassem</Word>
<Word>famorassem</Word>
<Word>privatescope</Word>
<Word>nested</Word>
<Word>hidebysig</Word>
<Word>newslot</Word>
<Word>rtspecialname</Word>
<Word>pinvokeimpl</Word>
<Word>unmanagedexp</Word>
<Word>reqsecobj</Word>
<Word>.ctor</Word>
<Word>.cctor</Word>
<Word>initonly</Word>
<Word>literal</Word>
<Word>notserialized</Word>
<Word>forwardref</Word>
<Word>internalcall</Word>
<Word>noinlining</Word>
<Word>aggressiveinlining</Word>
<Word>nomangle</Word>
<Word>lasterr</Word>
<Word>winapi</Word>
<Word>cdecl</Word>
<Word>stdcall</Word>
<Word>thiscall</Word>
<Word>fastcall</Word>
<Word>as</Word>
<Word>pinned</Word>
<Word>modreq</Word>
<Word>modopt</Word>
<Word>serializable</Word>
<Word>at</Word>
<Word>tls</Word>
<Word>true</Word>
<Word>false</Word>
<Word>strict</Word>
</Keywords>
<Keywords color="Directives">
<Word>.class</Word>
<Word>.namespace</Word>
<Word>.method</Word>
<Word>.field</Word>
<Word>.emitbyte</Word>
<Word>.try</Word>
<Word>.maxstack</Word>
<Word>.locals</Word>
<Word>.entrypoint</Word>
<Word>.zeroinit</Word>
<Word>.pdirect</Word>
<Word>.data</Word>
<Word>.event</Word>
<Word>.addon</Word>
<Word>.removeon</Word>
<Word>.fire</Word>
<Word>.other</Word>
<Word>protected</Word>
<Word>.property</Word>
<Word>.set</Word>
<Word>.get</Word>
<Word>default</Word>
<Word>.import</Word>
<Word>.permission</Word>
<Word>.permissionset</Word>
<Word>.line</Word>
<Word>.language</Word>
<Word>#line</Word>
</Keywords>
<Keywords color="Security">
<Word>request</Word>
<Word>demand</Word>
<Word>assert</Word>
<Word>deny</Word>
<Word>permitonly</Word>
<Word>linkcheck</Word>
<Word>inheritcheck</Word>
<Word>reqmin</Word>
<Word>reqopt</Word>
<Word>reqrefuse</Word>
<Word>prejitgrant</Word>
<Word>prejitdeny</Word>
<Word>noncasdemand</Word>
<Word>noncaslinkdemand</Word>
<Word>noncasinheritance</Word>
</Keywords>
<Keywords color="Directives">
<!-- custom value specifier -->
<Word>.custom</Word>
<!-- IL method attribute -->
<Word>init</Word>
<!-- Class layout directives -->
<Word>.size</Word>
<Word>.pack</Word>
<!-- Manifest-related keywords -->
<Word>.file</Word>
<Word>nometadata</Word>
<Word>.hash</Word>
<Word>.assembly</Word>
<Word>implicitcom</Word>
<Word>noappdomain</Word>
<Word>noprocess</Word>
<Word>nomachine</Word>
<Word>.publickey</Word>
<Word>.publickeytoken</Word>
<Word>algorithm</Word>
<Word>.ver</Word>
<Word>.locale</Word>
<Word>extern</Word>
<Word>.export</Word>
<Word>.manifestres</Word>
<Word>.mresource</Word>
<Word>.localized</Word>
<!-- Field marshaling keywords -->
<Word>.module</Word>
<Word>marshal</Word>
<Word>custom</Word>
<Word>sysstring</Word>
<Word>fixed</Word>
<Word>variant</Word>
<Word>currency</Word>
<Word>syschar</Word>
<Word>decimal</Word>
<Word>date</Word>
<Word>bstr</Word>
<Word>tbstr</Word>
<Word>lpstr</Word>
<Word>lpwstr</Word>
<Word>lptstr</Word>
<Word>objectref</Word>
<Word>iunknown</Word>
<Word>idispatch</Word>
<Word>struct</Word>
<Word>safearray</Word>
<Word>byvalstr</Word>
<Word>lpvoid</Word>
<Word>any</Word>
<Word>array</Word>
<Word>lpstruct</Word>
<!-- VTable fixup keywords -->
<Word>.vtfixup</Word>
<Word>fromunmanaged</Word>
<Word>callmostderived</Word>
<Word>.vtentry</Word>
<!-- Parameter attributes -->
<Word>in</Word>
<Word>out</Word>
<Word>opt</Word>
<Word>lcid</Word>
<Word>retval</Word>
<Word>.param</Word>
<!-- Method implementations -->
<Word>.override</Word>
<Word>with</Word>
<!-- VariantType keywords -->
<Word>null</Word>
<Word>error</Word>
<Word>hresult</Word>
<Word>carray</Word>
<Word>userdefined</Word>
<Word>record</Word>
<Word>filetime</Word>
<Word>blob</Word>
<Word>stream</Word>
<Word>storage</Word>
<Word>streamed_object</Word>
<Word>stored_object</Word>
<Word>blob_object</Word>
<Word>cf</Word>
<Word>clsid</Word>
<Word>vector</Word>
<!-- Null reference keyword for InitOpt -->
<Word>nullref</Word>
<!-- Header flags keywords -->
<Word>.subsystem</Word>
<Word>.corflags</Word>
<Word>.stackreserve</Word>
<Word>alignment</Word>
<Word>.imagebase</Word>
</Keywords>
<Span color="Comment" ruleSet="CommentMarkerSet">
<Begin>//</Begin>
</Span>
<Span color="Comment" ruleSet="CommentMarkerSet">
<Begin>/\*</Begin>
<End>\*/</End>
</Span>
<Span color="String">
<Begin>"</Begin>
<End>"</End>
</Span>
</RuleSet>
<RuleSet name="CommentMarkerSet" ignoreCase="false">
<Keywords foreground="#FFFF0000" fontWeight="bold">
<Word>TODO</Word>
<Word>FIXME</Word>
</Keywords>
<Keywords foreground="#EEE0E000" fontWeight="bold">
<Word>HACK</Word>
<Word>UNDONE</Word>
</Keywords>
</RuleSet>
</SyntaxDefinition>

63
ILSpy/TextView/XML-Mode-Dark.xshd

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
<SyntaxDefinition name="XML" extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.booproj;.build;.xfrm;.targets;.xaml;.xpt;.xft;.map;.wsdl;.disco;.ps1xml;.nuspec" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color foreground="Green" name="Comment" exampleText="&lt;!-- comment --&gt;" />
<Color foreground="#FFD69D85" name="CData" exampleText="&lt;![CDATA[data]]&gt;" />
<Color foreground="#FFD69D85" name="DocType" exampleText="&lt;!DOCTYPE rootElement&gt;" />
<Color foreground="#FFD69D85" name="XmlDeclaration" exampleText='&lt;?xml version="1.0"?&gt;' />
<Color foreground="#FFD69D85" name="XmlTag" exampleText='&lt;tag attribute="value" /&gt;' />
<Color foreground="#FF00A0FF" name="AttributeName" exampleText='&lt;tag attribute="value" /&gt;' />
<Color foreground="#FFD69D85" name="AttributeValue" exampleText='&lt;tag attribute="value" /&gt;' />
<Color foreground="#FFd8a0df" name="Entity" exampleText="index.aspx?a=1&amp;amp;b=2" />
<Color foreground="#FF559CD6" name="BrokenEntity" exampleText="index.aspx?a=1&amp;b=2" />
<RuleSet>
<Span color="Comment" multiline="true">
<Begin>&lt;!--</Begin>
<End>--&gt;</End>
</Span>
<Span color="CData" multiline="true">
<Begin>&lt;!\[CDATA\[</Begin>
<End>]]&gt;</End>
</Span>
<Span color="DocType" multiline="true">
<Begin>&lt;!DOCTYPE</Begin>
<End>&gt;</End>
</Span>
<Span color="XmlDeclaration" multiline="true">
<Begin>&lt;\?</Begin>
<End>\?&gt;</End>
</Span>
<Span color="XmlTag" multiline="true">
<Begin>&lt;</Begin>
<End>&gt;</End>
<RuleSet>
<!-- Treat the position before '<' as end, as that's not a valid character
in attribute names and indicates the user forgot a closing quote. -->
<Span color="AttributeValue" multiline="true" ruleSet="EntitySet">
<Begin>"</Begin>
<End>"|(?=&lt;)</End>
</Span>
<Span color="AttributeValue" multiline="true" ruleSet="EntitySet">
<Begin>'</Begin>
<End>'|(?=&lt;)</End>
</Span>
<Rule color="AttributeName">[\d\w_\-\.]+(?=(\s*=))</Rule>
<Rule color="AttributeValue">=</Rule>
</RuleSet>
</Span>
<Import ruleSet="EntitySet"/>
</RuleSet>
<RuleSet name="EntitySet">
<Rule color="Entity">
&amp;
[\w\d\#]+
;
</Rule>
<Rule color="BrokenEntity">
&amp;
[\w\d\#]*
#missing ;
</Rule>
</RuleSet>
</SyntaxDefinition>

63
ILSpy/TextView/XML-Mode.xshd

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
<SyntaxDefinition name="XML" extensions=".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;.xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;.booproj;.build;.xfrm;.targets;.xaml;.xpt;.xft;.map;.wsdl;.disco;.ps1xml;.nuspec" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color foreground="Green" name="Comment" exampleText="&lt;!-- comment --&gt;" />
<Color foreground="Blue" name="CData" exampleText="&lt;![CDATA[data]]&gt;" />
<Color foreground="Blue" name="DocType" exampleText="&lt;!DOCTYPE rootElement&gt;" />
<Color foreground="Blue" name="XmlDeclaration" exampleText='&lt;?xml version="1.0"?&gt;' />
<Color foreground="DarkMagenta" name="XmlTag" exampleText='&lt;tag attribute="value" /&gt;' />
<Color foreground="Red" name="AttributeName" exampleText='&lt;tag attribute="value" /&gt;' />
<Color foreground="Blue" name="AttributeValue" exampleText='&lt;tag attribute="value" /&gt;' />
<Color foreground="Teal" name="Entity" exampleText="index.aspx?a=1&amp;amp;b=2" />
<Color foreground="Olive" name="BrokenEntity" exampleText="index.aspx?a=1&amp;b=2" />
<RuleSet>
<Span color="Comment" multiline="true">
<Begin>&lt;!--</Begin>
<End>--&gt;</End>
</Span>
<Span color="CData" multiline="true">
<Begin>&lt;!\[CDATA\[</Begin>
<End>]]&gt;</End>
</Span>
<Span color="DocType" multiline="true">
<Begin>&lt;!DOCTYPE</Begin>
<End>&gt;</End>
</Span>
<Span color="XmlDeclaration" multiline="true">
<Begin>&lt;\?</Begin>
<End>\?&gt;</End>
</Span>
<Span color="XmlTag" multiline="true">
<Begin>&lt;</Begin>
<End>&gt;</End>
<RuleSet>
<!-- Treat the position before '<' as end, as that's not a valid character
in attribute names and indicates the user forgot a closing quote. -->
<Span color="AttributeValue" multiline="true" ruleSet="EntitySet">
<Begin>"</Begin>
<End>"|(?=&lt;)</End>
</Span>
<Span color="AttributeValue" multiline="true" ruleSet="EntitySet">
<Begin>'</Begin>
<End>'|(?=&lt;)</End>
</Span>
<Rule color="AttributeName">[\d\w_\-\.]+(?=(\s*=))</Rule>
<Rule color="AttributeValue">=</Rule>
</RuleSet>
</Span>
<Import ruleSet="EntitySet"/>
</RuleSet>
<RuleSet name="EntitySet">
<Rule color="Entity">
&amp;
[\w\d\#]+
;
</Rule>
<Rule color="BrokenEntity">
&amp;
[\w\d\#]*
#missing ;
</Rule>
</RuleSet>
</SyntaxDefinition>

50
ILSpy/ThemeManager.cs

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace ICSharpCode.ILSpy
{
internal class ThemeManager
{
private bool _isDarkMode;
private readonly ResourceDictionary _themeDictionaryContainer = new ResourceDictionary();
public static readonly ThemeManager Current = new ThemeManager();
private ThemeManager()
{
Application.Current.Resources.MergedDictionaries.Add(_themeDictionaryContainer);
}
public bool IsDarkMode {
get => _isDarkMode;
set {
_isDarkMode = value;
_themeDictionaryContainer.MergedDictionaries.Clear();
string theme = value ? "Dark" : "Light";
_themeDictionaryContainer.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri($"themes/{theme}Theme.xaml", UriKind.Relative) });
}
}
public Button CreateButton()
{
return new Button {
Style = CreateButtonStyle()
};
}
public Style CreateButtonStyle()
{
return new Style(typeof(Button), (Style)Application.Current.FindResource(typeof(Button)));
}
public Style CreateToolBarButtonStyle()
{
return new Style(typeof(Button), (Style)Application.Current.FindResource(ToolBar.ButtonStyleKey));
}
}
}

2
ILSpy/TreeNodes/AssemblyTreeNode.cs

@ -547,7 +547,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -547,7 +547,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
if (!loadedAssm.HasLoadError)
{
loadedAssm.IsAutoLoaded = false;
node.RaisePropertyChanged(nameof(node.Foreground));
node.RaisePropertyChanged(nameof(ILSpyTreeNode.IsAutoLoaded));
}
}
MainWindow.Instance.CurrentAssemblyList.RefreshSave();

17
ILSpy/TreeNodes/ILSpyTreeNode.cs

@ -185,22 +185,5 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -185,22 +185,5 @@ namespace ICSharpCode.ILSpy.TreeNodes
public virtual bool IsAutoLoaded {
get { return false; }
}
public override System.Windows.Media.Brush Foreground {
get {
if (IsPublicAPI)
if (IsAutoLoaded)
{
// HACK: should not be hard coded?
return System.Windows.Media.Brushes.SteelBlue;
}
else
{
return base.Foreground;
}
else
return System.Windows.SystemColors.GrayTextBrush;
}
}
}
}

60
ILSpy/themes/DarkTheme.xaml

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:styles="urn:TomsToolbox.Wpf.Styles"
xmlns:themes="clr-namespace:ICSharpCode.ILSpy.themes">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/AvalonDock.Themes.VS2013;component/darktheme.xaml" />
</ResourceDictionary.MergedDictionaries>
<Color x:Key="{x:Static SystemColors.ControlLightLightColorKey}">#333337</Color>
<Color x:Key="{x:Static SystemColors.ControlLightColorKey}">#464646</Color>
<Color x:Key="{x:Static SystemColors.ControlColorKey}">#252526</Color>
<Color x:Key="{x:Static SystemColors.ControlDarkColorKey}">#686868</Color>
<Color x:Key="{x:Static SystemColors.ControlDarkDarkColorKey}">#9E9E9E</Color>
<Color x:Key="{x:Static SystemColors.ControlTextColorKey}">#F1F1F1</Color>
<Color x:Key="{x:Static SystemColors.GrayTextColorKey}">#999999</Color>
<Color x:Key="{x:Static SystemColors.HighlightColorKey}">#3399FF</Color>
<Color x:Key="{x:Static SystemColors.HighlightTextColorKey}">#FFFFFF</Color>
<Color x:Key="{x:Static SystemColors.InfoTextColorKey}">#F1F1F1</Color>
<Color x:Key="{x:Static SystemColors.InfoColorKey}">#333337</Color>
<Color x:Key="{x:Static SystemColors.MenuColorKey}">#1B1B1C</Color>
<Color x:Key="{x:Static SystemColors.MenuBarColorKey}">#1B1B1C</Color>
<Color x:Key="{x:Static SystemColors.MenuTextColorKey}">#F1F1F1</Color>
<Color x:Key="{x:Static SystemColors.WindowColorKey}">#333337</Color>
<Color x:Key="{x:Static SystemColors.WindowTextColorKey}">#F1F1F1</Color>
<Color x:Key="{x:Static SystemColors.ActiveCaptionColorKey}">#2D2D30</Color>
<Color x:Key="{x:Static SystemColors.ActiveBorderColorKey}">#007ACC</Color>
<Color x:Key="{x:Static SystemColors.ActiveCaptionTextColorKey}">#F1F1F1</Color>
<Color x:Key="{x:Static SystemColors.InactiveCaptionColorKey}">#2D2D30</Color>
<Color x:Key="{x:Static SystemColors.InactiveBorderColorKey}">#434346</Color>
<Color x:Key="{x:Static SystemColors.InactiveCaptionTextColorKey}">#F1F1F1</Color>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlLightLightBrushKey}" Color="#333337" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlLightBrushKey}" Color="#464646" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#252526" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkBrushKey}" Color="#686868" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#9E9E9E" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="#F1F1F1" />
<SolidColorBrush x:Key="{x:Static SystemColors.GrayTextBrushKey}" Color="#999999" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#3399FF" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="#FFFFFF" />
<SolidColorBrush x:Key="{x:Static SystemColors.InfoTextBrushKey}" Color="#F1F1F1" />
<SolidColorBrush x:Key="{x:Static SystemColors.InfoBrushKey}" Color="#333337" />
<SolidColorBrush x:Key="{x:Static SystemColors.MenuBrushKey}" Color="#1B1B1C" />
<SolidColorBrush x:Key="{x:Static SystemColors.MenuBarBrushKey}" Color="#1B1B1C" />
<SolidColorBrush x:Key="{x:Static SystemColors.MenuTextBrushKey}" Color="#F1F1F1" />
<SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="#333337" />
<SolidColorBrush x:Key="{x:Static SystemColors.WindowTextBrushKey}" Color="#F1F1F1" />
<SolidColorBrush x:Key="{x:Static SystemColors.ActiveCaptionBrushKey}" Color="#2D2D30" />
<SolidColorBrush x:Key="{x:Static SystemColors.ActiveBorderBrushKey}" Color="#007ACC" />
<SolidColorBrush x:Key="{x:Static SystemColors.ActiveCaptionTextBrushKey}" Color="#F1F1F1" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveCaptionBrushKey}" Color="#2D2D30" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveBorderBrushKey}" Color="#434346" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveCaptionTextBrushKey}" Color="#F1F1F1" />
<SolidColorBrush x:Key="{x:Static styles:ResourceKeys.BorderBrush}" Color="#9E9E9E" />
<SolidColorBrush x:Key="{x:Static styles:ResourceKeys.DisabledBrush}" Color="#2D2D30" />
<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerBackgroundColor}">MediumVioletRed</Color>
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LinkTextForegroundBrush}">CornflowerBlue</SolidColorBrush>
</ResourceDictionary>

52
ILSpy/themes/LightTheme.xaml

@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:styles="urn:TomsToolbox.Wpf.Styles">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/AvalonDock.Themes.VS2013;component/lighttheme.xaml" />
</ResourceDictionary.MergedDictionaries>
<Color x:Key="{x:Static SystemColors.ControlLightLightColorKey}">#FCFCFC</Color>
<Color x:Key="{x:Static SystemColors.ControlLightColorKey}">#D8D8E0</Color>
<Color x:Key="{x:Static SystemColors.ControlColorKey}">#F5F5F5</Color>
<Color x:Key="{x:Static SystemColors.ControlDarkColorKey}">#C2C3C9</Color>
<Color x:Key="{x:Static SystemColors.ControlDarkDarkColorKey}">#686868</Color>
<Color x:Key="{x:Static SystemColors.ControlTextColorKey}">#1E1E1E</Color>
<Color x:Key="{x:Static SystemColors.GrayTextColorKey}">#717171</Color>
<Color x:Key="{x:Static SystemColors.HighlightColorKey}">#3399FF</Color>
<Color x:Key="{x:Static SystemColors.HighlightTextColorKey}">#FFFFFF</Color>
<Color x:Key="{x:Static SystemColors.MenuColorKey}">#F6F6F6</Color>
<Color x:Key="{x:Static SystemColors.MenuBarColorKey}">#F6F6F6</Color>
<Color x:Key="{x:Static SystemColors.MenuTextColorKey}">#1E1E1E</Color>
<Color x:Key="{x:Static SystemColors.WindowColorKey}">#FFFFFF</Color>
<Color x:Key="{x:Static SystemColors.WindowTextColorKey}">#1E1E1E</Color>
<Color x:Key="{x:Static SystemColors.ActiveCaptionColorKey}">#EEEEF2</Color>
<Color x:Key="{x:Static SystemColors.ActiveBorderColorKey}">#007ACC</Color>
<Color x:Key="{x:Static SystemColors.ActiveCaptionTextColorKey}">#1E1E1E</Color>
<Color x:Key="{x:Static SystemColors.InactiveCaptionColorKey}">#EEEEF2</Color>
<Color x:Key="{x:Static SystemColors.InactiveBorderColorKey}">#CCCEDB</Color>
<Color x:Key="{x:Static SystemColors.InactiveCaptionTextColorKey}">#1E1E1E</Color>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlLightLightBrushKey}" Color="#FCFCFC" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlLightBrushKey}" Color="#D8D8E0" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#F5F5F5" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkBrushKey}" Color="#C2C3C9" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#686868" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="#1E1E1E" />
<SolidColorBrush x:Key="{x:Static SystemColors.GrayTextBrushKey}" Color="#717171" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#3399FF" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="#FFFFFF" />
<SolidColorBrush x:Key="{x:Static SystemColors.MenuBrushKey}" Color="#F6F6F6" />
<SolidColorBrush x:Key="{x:Static SystemColors.MenuBarBrushKey}" Color="#F6F6F6" />
<SolidColorBrush x:Key="{x:Static SystemColors.MenuTextBrushKey}" Color="#1E1E1E" />
<SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="#FFFFFF" />
<SolidColorBrush x:Key="{x:Static SystemColors.WindowTextBrushKey}" Color="#1E1E1E" />
<SolidColorBrush x:Key="{x:Static SystemColors.ActiveCaptionBrushKey}" Color="#EEEEF2" />
<SolidColorBrush x:Key="{x:Static SystemColors.ActiveBorderBrushKey}" Color="#007ACC" />
<SolidColorBrush x:Key="{x:Static SystemColors.ActiveCaptionTextBrushKey}" Color="#1E1E1E" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveCaptionBrushKey}" Color="#EEEEF2" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveBorderBrushKey}" Color="#CCCEDB" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveCaptionTextBrushKey}" Color="#1E1E1E" />
<SolidColorBrush x:Key="{x:Static styles:ResourceKeys.BorderBrush}" Color="#686868" />
<SolidColorBrush x:Key="{x:Static styles:ResourceKeys.DisabledBrush}" Color="#EEEEF2" />
</ResourceDictionary>

11
ILSpy/themes/ResourceKeys.cs

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
using System.Windows;
namespace ICSharpCode.ILSpy.themes
{
public static class ResourceKeys
{
public static ResourceKey TextMarkerBackgroundColor = new ComponentResourceKey(typeof(ResourceKeys), "TextMarkerBackgroundColor");
public static ResourceKey TextMarkerDefinitionBackgroundColor = new ComponentResourceKey(typeof(ResourceKeys), "TextMarkerDefinitionBackgroundColor");
public static ResourceKey LinkTextForegroundBrush = new ComponentResourceKey(typeof(ResourceKeys), "LinkTextForegroundBrush");
}
}

6
ILSpy/themes/generic.xaml

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:ICSharpCode.ILSpy.Controls"
>
xmlns:themes="clr-namespace:ICSharpCode.ILSpy.themes">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Controls/SearchBoxStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
@ -26,4 +26,8 @@ @@ -26,4 +26,8 @@
Data = "M 5,5 L 10,10 L 15,5 L 5,5"/>
</StackPanel>
</DataTemplate>
<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerBackgroundColor}">GreenYellow</Color>
<Color x:Key="{x:Static themes:ResourceKeys.TextMarkerDefinitionBackgroundColor}">LightSeaGreen</Color>
<SolidColorBrush x:Key="{x:Static themes:ResourceKeys.LinkTextForegroundBrush}">Blue</SolidColorBrush>
</ResourceDictionary>

4
SharpTreeView/ICSharpCode.TreeView.csproj

@ -64,4 +64,8 @@ @@ -64,4 +64,8 @@
<Compile Include="TreeTraversal.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="TomsToolbox.Wpf.Styles" Version="2.4.2" />
</ItemGroup>
</Project>

4
SharpTreeView/SharpTreeNode.cs

@ -122,10 +122,6 @@ namespace ICSharpCode.TreeView @@ -122,10 +122,6 @@ namespace ICSharpCode.TreeView
get { return null; }
}
public virtual Brush Foreground {
get { return SystemColors.WindowTextBrush; }
}
public virtual object Icon {
get { return null; }
}

4
SharpTreeView/SharpTreeView.cs

@ -669,8 +669,8 @@ namespace ICSharpCode.TreeView @@ -669,8 +669,8 @@ namespace ICSharpCode.TreeView
if (place == DropPlace.Inside)
{
previewNodeView.TextBackground = SystemColors.HighlightBrush;
previewNodeView.Foreground = SystemColors.HighlightTextBrush;
previewNodeView.SetResourceReference(SharpTreeNodeView.TextBackgroundProperty, SystemColors.HighlightBrushKey);
previewNodeView.SetResourceReference(SharpTreeNodeView.ForegroundProperty, SystemColors.HighlightTextBrushKey);
}
else
{

35
SharpTreeView/Themes/Generic.xaml

@ -1,12 +1,10 @@ @@ -1,12 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Default="clr-namespace:ICSharpCode.TreeView">
<SolidColorBrush x:Key="ListBorder"
Color="#FF7F9DB9" />
xmlns:Default="clr-namespace:ICSharpCode.TreeView"
xmlns:styles="urn:TomsToolbox.Wpf.Styles">
<Style x:Key="ExpandCollapseToggleStyle"
TargetType="{x:Type ToggleButton}">
TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Focusable"
Value="False" />
<Setter Property="Template">
@ -15,7 +13,7 @@ @@ -15,7 +13,7 @@
<Border Width="9"
Height="9"
BorderThickness="1"
BorderBrush="#FF7898B5"
BorderBrush="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}"
CornerRadius="1"
SnapsToDevicePixels="True">
<Border.Background>
@ -85,7 +83,7 @@ @@ -85,7 +83,7 @@
<ControlTemplate TargetType="{x:Type Default:EditTextBox}">
<Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
BorderThickness="1"
BorderBrush="{StaticResource ListBorder}"
BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"
Padding="0 1 2 0">
<ScrollViewer Name="PART_ContentHost" />
</Border>
@ -95,7 +93,7 @@ @@ -95,7 +93,7 @@
</Style>
<Style TargetType="{x:Type Default:SharpTreeView}"
BasedOn="{StaticResource {x:Type ListBox}}">
BasedOn="{StaticResource {x:Static styles:ResourceKeys.ListBoxStyle}}">
<Style.Triggers>
<Trigger Property="ShowRoot"
Value="False">
@ -116,13 +114,13 @@ @@ -116,13 +114,13 @@
Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background"
Value="WhiteSmoke" />
Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}" />
</MultiTrigger>
</Style.Triggers>
</Style>
<Style x:Key="{x:Static Default:SharpGridView.ItemContainerStyleKey}"
TargetType="{x:Type ListViewItem}">
TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
<Setter Property="Background"
Value="Transparent" />
<Setter Property="VerticalContentAlignment"
@ -180,14 +178,21 @@ @@ -180,14 +178,21 @@
<ControlTemplate TargetType="{x:Type Default:SharpTreeViewItem}">
<Border Background="Transparent">
<Border Background="{TemplateBinding Background}">
<Default:SharpTreeNodeView Name="nodeView"
Foreground="{Binding Foreground}"
<Default:SharpTreeNodeView x:Name="nodeView"
HorizontalAlignment="Left" />
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected"
Value="True">
<DataTrigger Binding="{Binding IsAutoLoaded}"
Value="True">
<Setter Property="Foreground" Value="SteelBlue" />
</DataTrigger>
<DataTrigger Binding="{Binding IsPublicAPI}"
Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</DataTrigger>
<Trigger Property="IsSelected"
Value="True">
<Setter TargetName="nodeView"
Property="TextBackground"
Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
@ -228,7 +233,7 @@ @@ -228,7 +233,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:SharpTreeNodeView}">
<Grid>
<Default:LinesRenderer Name="linesRenderer"
<Default:LinesRenderer x:Name="linesRenderer"
ClipToBounds="True"
Visibility="{Binding ShowLines, RelativeSource={RelativeSource AncestorType={x:Type Default:SharpTreeView}}, Converter={Default:CollapsedWhenFalse}}" />
<StackPanel Orientation="Horizontal">

2
packages.props

@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
<ILAsmVersion>5.0.0</ILAsmVersion> <!-- Microsoft.NETCore.ILAsm -->
<RoslynVersion>3.8.0</RoslynVersion> <!-- Microsoft.CodeAnalysis.* -->
<MonoCecilVersion>0.11.3</MonoCecilVersion>
<AvalonEditVersion>6.1.0</AvalonEditVersion>
<AvalonEditVersion>6.1.1</AvalonEditVersion>
<NUnitVersion>3.12.0</NUnitVersion>
<NUnitAdapterVersion>3.13.0</NUnitAdapterVersion>
<MoqVersion>4.14.1</MoqVersion>

Loading…
Cancel
Save