You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
284 lines
15 KiB
284 lines
15 KiB
<?xml version="1.0" encoding="utf-8"?>
|
|
<Window
|
|
x:Class="ICSharpCode.ILSpy.MainWindow"
|
|
x:ClassModifier="public"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:tv="clr-namespace:ICSharpCode.TreeView;assembly=ICSharpCode.TreeView"
|
|
xmlns:local="clr-namespace:ICSharpCode.ILSpy"
|
|
xmlns:search="clr-namespace:ICSharpCode.ILSpy.Search"
|
|
xmlns:avalondock="https://github.com/Dirkster99/AvalonDock"
|
|
xmlns:controls="clr-namespace:ICSharpCode.ILSpy.Controls"
|
|
xmlns:docking="clr-namespace:ICSharpCode.ILSpy.Docking"
|
|
xmlns:analyzers="clr-namespace:ICSharpCode.ILSpy.Analyzers"
|
|
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
|
|
Title="ILSpy"
|
|
MinWidth="250"
|
|
MinHeight="200"
|
|
UseLayoutRounding="True"
|
|
TextOptions.TextFormattingMode="Display"
|
|
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"
|
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:themes="clr-namespace:ICSharpCode.ILSpy.Themes"
|
|
d:DataContext="{d:DesignInstance local:MainWindowViewModel}"
|
|
>
|
|
<Window.Resources>
|
|
<controls:BoolToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
|
<docking:ActiveTabPageConverter x:Key="ActiveTabPageConverter"/>
|
|
|
|
<tv:SharpTreeView x:Key="AssemblyTreeView"
|
|
AutomationProperties.Name="Assemblies and Classes"
|
|
SelectionChanged="TreeView_SelectionChanged"
|
|
ShowRoot="False"
|
|
AllowDropOrder="True"
|
|
AllowDrop="True"
|
|
BorderThickness="0" Visibility="Visible">
|
|
<tv:SharpTreeView.ItemContainerStyle>
|
|
<Style TargetType="tv:SharpTreeViewItem">
|
|
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type tv:SharpTreeViewItem}">
|
|
<Border Background="Transparent">
|
|
<Border Background="{TemplateBinding Background}">
|
|
<tv:SharpTreeNodeView x:Name="nodeView" HorizontalAlignment="Left" />
|
|
</Border>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<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}}" />
|
|
<Setter TargetName="nodeView" Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter TargetName="nodeView" Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</tv:SharpTreeView.ItemContainerStyle>
|
|
</tv:SharpTreeView>
|
|
|
|
<DataTemplate x:Key="AssemblyListPaneTemplate">
|
|
<ContentControl Content="{StaticResource AssemblyTreeView}" />
|
|
</DataTemplate>
|
|
|
|
<local:DebugSteps x:Key="DebugSteps" />
|
|
|
|
<DataTemplate x:Key="DebugStepsPaneTemplate">
|
|
<ContentControl Content="{StaticResource DebugSteps}" />
|
|
</DataTemplate>
|
|
|
|
<search:SearchPane x:Key="SearchPane" />
|
|
|
|
<DataTemplate x:Key="SearchPaneTemplate">
|
|
<ContentControl Content="{StaticResource SearchPane}" />
|
|
</DataTemplate>
|
|
|
|
<analyzers:AnalyzerTreeView x:Key="AnalyzerTreeView" />
|
|
|
|
<DataTemplate x:Key="AnalyzerPaneTemplate">
|
|
<ContentControl Content="{StaticResource AnalyzerTreeView}" />
|
|
</DataTemplate>
|
|
|
|
<DataTemplate x:Key="DefaultContentTemplate">
|
|
<ContentPresenter Content="{Binding Content}" />
|
|
</DataTemplate>
|
|
|
|
<styles:InvertGrayEffect x:Key="InvertGrayEffect" />
|
|
|
|
<controls:CultureSelectionConverter x:Key="cultureSelectionConverter" />
|
|
|
|
</Window.Resources>
|
|
<b:Interaction.Behaviors>
|
|
<themes:WindowStyleManagerBehavior />
|
|
</b:Interaction.Behaviors>
|
|
|
|
<Window.CommandBindings>
|
|
<CommandBinding
|
|
Command="Open"
|
|
Executed="OpenCommandExecuted" />
|
|
<CommandBinding
|
|
Command="Refresh"
|
|
Executed="RefreshCommandExecuted" />
|
|
<CommandBinding
|
|
Command="Save"
|
|
CanExecute="SaveCommandCanExecute"
|
|
Executed="SaveCommandExecuted" />
|
|
<CommandBinding
|
|
Command="BrowseBack"
|
|
CanExecute="BackCommandCanExecute"
|
|
Executed="BackCommandExecuted" />
|
|
<CommandBinding
|
|
Command="BrowseForward"
|
|
CanExecute="ForwardCommandCanExecute"
|
|
Executed="ForwardCommandExecuted" />
|
|
<CommandBinding
|
|
Command="Search"
|
|
Executed="SearchCommandExecuted" />
|
|
</Window.CommandBindings>
|
|
<Window.InputBindings>
|
|
<KeyBinding Key="R" Modifiers="Control" Command="{x:Static local:ILSpyCommands.Analyze}" />
|
|
</Window.InputBindings>
|
|
<Window.TaskbarItemInfo>
|
|
<TaskbarItemInfo />
|
|
</Window.TaskbarItemInfo>
|
|
<DockPanel>
|
|
<!-- Main menu -->
|
|
<Menu DockPanel.Dock="Top" Name="mainMenu" Height="23" KeyboardNavigation.TabNavigation="None">
|
|
<MenuItem Header="{x:Static properties:Resources._File}" Tag="_File" />
|
|
<!-- contents of file menu are added using MEF -->
|
|
<MenuItem Header="{x:Static properties:Resources._View}" Tag="_View">
|
|
<MenuItem Header="{x:Static properties:Resources.Show_publiconlyTypesMembers}" IsCheckable="True" IsChecked="{Binding Workspace.ActiveTabPage.FilterSettings.ApiVisPublicOnly}" />
|
|
<MenuItem Header="{x:Static properties:Resources.Show_internalTypesMembers}" IsCheckable="True" IsChecked="{Binding Workspace.ActiveTabPage.FilterSettings.ApiVisPublicAndInternal}" />
|
|
<MenuItem Header="{x:Static properties:Resources.Show_allTypesAndMembers}" IsCheckable="True" IsChecked="{Binding Workspace.ActiveTabPage.FilterSettings.ApiVisAll}" />
|
|
<Separator/>
|
|
<MenuItem Header="{x:Static properties:Resources.UILanguage}">
|
|
<MenuItem Header="{x:Static properties:Resources.UILanguage_System}" IsCheckable="True" IsChecked="{Binding SessionSettings.CurrentCulture, Converter={StaticResource cultureSelectionConverter}, ConverterParameter={x:Null}}" />
|
|
<MenuItem Header="English" IsCheckable="True" IsChecked="{Binding SessionSettings.CurrentCulture, Converter={StaticResource cultureSelectionConverter}, ConverterParameter=en-US}" />
|
|
<MenuItem Header="中文" IsCheckable="True" IsChecked="{Binding SessionSettings.CurrentCulture, Converter={StaticResource cultureSelectionConverter}, ConverterParameter=zh-Hans}" />
|
|
</MenuItem>
|
|
</MenuItem>
|
|
<MenuItem Header="{x:Static properties:Resources._Window}" Tag="_Window" />
|
|
</Menu>
|
|
<!-- ToolBar -->
|
|
<ToolBar
|
|
Name="toolBar"
|
|
DockPanel.Dock="Top" ToolBarTray.IsLocked="True" KeyboardNavigation.TabNavigation="None">
|
|
<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>
|
|
<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 />
|
|
<!-- 'Open' toolbar category is inserted here -->
|
|
<Separator />
|
|
<ComboBox Name="assemblyListComboBox" Width="100" MaxDropDownHeight="Auto"
|
|
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}" Style="{StaticResource DarkModeAwareImageStyle}"/>
|
|
</Button>
|
|
<Separator />
|
|
<CheckBox IsChecked="{Binding Workspace.ActiveTabPage.FilterSettings.ApiVisPublicOnly}" ToolTip="{x:Static properties:Resources.ShowPublicOnlyTypesMembers}">
|
|
<Image Width="16" Height="16" Source="{controls:XamlResource Images/ShowPublicOnly}" Style="{StaticResource DarkModeAwareImageStyle}"/>
|
|
</CheckBox>
|
|
<CheckBox IsChecked="{Binding Workspace.ActiveTabPage.FilterSettings.ApiVisPublicAndInternal}" ToolTip="{x:Static properties:Resources.ShowInternalTypesMembers}">
|
|
<Image Width="16" Height="16" Source="{controls:XamlResource Images/ShowPrivateInternal}" Style="{StaticResource DarkModeAwareImageStyle}"/>
|
|
</CheckBox>
|
|
<CheckBox IsChecked="{Binding Workspace.ActiveTabPage.FilterSettings.ApiVisAll}" ToolTip="{x:Static properties:Resources.ShowAllTypesAndMembers}">
|
|
<Image Width="16" Height="16" Source="{controls:XamlResource Images/ShowAll}" Style="{StaticResource DarkModeAwareImageStyle}"/>
|
|
</CheckBox>
|
|
<Separator />
|
|
<ComboBox Name="languageComboBox" DisplayMemberPath="Name" Width="100" MaxDropDownHeight="Auto"
|
|
IsEnabled="{Binding Workspace.ActiveTabPage.SupportsLanguageSwitching}"
|
|
ItemsSource="{x:Static local:Languages.AllLanguages}" ToolTip="{x:Static properties:Resources.SelectLanguageDropdownTooltip}"
|
|
SelectedItem="{Binding Workspace.ActiveTabPage.FilterSettings.Language}"/>
|
|
<ComboBox Name="languageVersionComboBox" DisplayMemberPath="DisplayName" Width="120" MaxDropDownHeight="Auto" ToolTip="{x:Static properties:Resources.SelectVersionDropdownTooltip}"
|
|
Visibility="{Binding SelectedItem.HasLanguageVersions, ElementName=languageComboBox, Converter={StaticResource BooleanToVisibilityConverter}}"
|
|
IsEnabled="{Binding Workspace.ActiveTabPage.SupportsLanguageSwitching}"
|
|
ItemsSource="{Binding SelectedItem.LanguageVersions, ElementName=languageComboBox, UpdateSourceTrigger=PropertyChanged}"
|
|
SelectedItem="{Binding Workspace.ActiveTabPage.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">
|
|
<Button DockPanel.Dock="Right" Click="updatePanelCloseButtonClick" MinWidth="0">X</Button>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Name="updatePanelMessage" Margin="4,0" VerticalAlignment="Center" Text="{x:Static properties:Resources.ILSpyVersionAvailable}" />
|
|
<Button Name="downloadOrCheckUpdateButton" Click="downloadOrCheckUpdateButtonClick" Content="{x:Static properties:Resources.Download}"/>
|
|
</StackPanel>
|
|
</DockPanel>
|
|
</Border>
|
|
<!-- Status bar -->
|
|
<StatusBar x:Name="statusBar" DockPanel.Dock="Bottom" Height="26" Visibility="Collapsed">
|
|
<StatusBarItem DockPanel.Dock="Right">
|
|
<TextBlock VerticalAlignment="Center"
|
|
HorizontalAlignment="Right"
|
|
x:Name="StatusLabel"
|
|
ToolTip="{x:Static properties:Resources.Status}"
|
|
Text="{x:Static properties:Resources.StandBy}"/>
|
|
</StatusBarItem>
|
|
</StatusBar>
|
|
|
|
<avalondock:DockingManager x:Name="DockManager"
|
|
DataContext="{Binding Workspace}"
|
|
AnchorablesSource="{Binding ToolPanes}"
|
|
DocumentsSource="{Binding TabPages}"
|
|
ActiveContent="{Binding ActiveTabPage, Mode=TwoWay, Converter={StaticResource ActiveTabPageConverter}}"
|
|
AllowMixedOrientation="True">
|
|
|
|
<avalondock:DockingManager.DocumentHeaderTemplate>
|
|
<DataTemplate>
|
|
<TextBlock x:Name="headerText" Text="{Binding Title}" />
|
|
<DataTemplate.Triggers>
|
|
<DataTrigger Binding="{Binding IsActive}" Value="True">
|
|
<Setter TargetName="headerText" Property="FontWeight" Value="Bold" />
|
|
</DataTrigger>
|
|
</DataTemplate.Triggers>
|
|
</DataTemplate>
|
|
</avalondock:DockingManager.DocumentHeaderTemplate>
|
|
|
|
<avalondock:DockingManager.LayoutItemContainerStyleSelector>
|
|
<docking:PaneStyleSelector>
|
|
<docking:PaneStyleSelector.ToolPaneStyle>
|
|
<Style TargetType="{x:Type avalondock:LayoutAnchorableItem}">
|
|
<Setter Property="Title" Value="{Binding Model.Title}"/>
|
|
<Setter Property="Visibility" Value="{Binding Model.IsVisible, Mode=TwoWay, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter={x:Static Visibility.Hidden}}"/>
|
|
<Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
|
|
<Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/>
|
|
<Setter Property="IsActive" Value="{Binding Model.IsActive, Mode=TwoWay}"/>
|
|
<Setter Property="CanHide" Value="{Binding Model.IsCloseable}" />
|
|
<Setter Property="HideCommand" Value="{Binding Model.CloseCommand}" />
|
|
<Setter Property="CanClose" Value="{Binding Model.IsCloseable}" />
|
|
<Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}" />
|
|
</Style>
|
|
</docking:PaneStyleSelector.ToolPaneStyle>
|
|
<docking:PaneStyleSelector.TabPageStyle>
|
|
<Style TargetType="{x:Type avalondock:LayoutItem}">
|
|
<Setter Property="Title" Value="{Binding Model.Title}"/>
|
|
<Setter Property="Visibility" Value="{Binding Model.IsVisible, Mode=TwoWay, Converter={StaticResource BooleanToVisibilityConverter}, ConverterParameter={x:Static Visibility.Hidden}}"/>
|
|
<Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
|
|
<Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/>
|
|
<Setter Property="IsActive" Value="{Binding Model.IsActive, Mode=TwoWay}"/>
|
|
<Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}" />
|
|
<Setter Property="CanClose" Value="{Binding Model.IsCloseable, Mode=TwoWay}" />
|
|
</Style>
|
|
</docking:PaneStyleSelector.TabPageStyle>
|
|
</docking:PaneStyleSelector>
|
|
</avalondock:DockingManager.LayoutItemContainerStyleSelector>
|
|
</avalondock:DockingManager>
|
|
</DockPanel>
|
|
</Window>
|