Browse Source

work on avalondock

pull/1725/head
jkuehner 6 years ago committed by Siegfried Pammer
parent
commit
851ee29261
  1. 2
      ILSpy/ILSpy.csproj
  2. 188
      ILSpy/MainWindow.xaml
  3. 12
      ILSpy/MainWindow.xaml.cs

2
ILSpy/ILSpy.csproj

@ -49,6 +49,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="AvalonEdit" Version="6.0.0" /> <PackageReference Include="AvalonEdit" Version="6.0.0" />
<PackageReference Include="Dirkster.AvalonDock" Version="3.5.12" />
<PackageReference Include="Microsoft.DiaSymReader.Converter.Xml" Version="1.1.0-beta1-63314-01" />
<PackageReference Include="Microsoft.VisualStudio.Composition" Version="15.5.23" /> <PackageReference Include="Microsoft.VisualStudio.Composition" Version="15.5.23" />
<PackageReference Include="Mono.Cecil" Version="0.10.3" /> <PackageReference Include="Mono.Cecil" Version="0.10.3" />
<PackageReference Include="OSVersionHelper" Version="1.0.11" /> <PackageReference Include="OSVersionHelper" Version="1.0.11" />

188
ILSpy/MainWindow.xaml

@ -4,7 +4,7 @@
x:ClassModifier="public" 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="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:local="clr-namespace:ICSharpCode.ILSpy"
xmlns:textView="clr-namespace:ICSharpCode.ILSpy.TextView" xmlns:avalondock="http://schemas.xceed.com/wpf/xaml/avalondock"
xmlns:controls="clr-namespace:ICSharpCode.ILSpy.Controls" xmlns:controls="clr-namespace:ICSharpCode.ILSpy.Controls"
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties" xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
Title="ILSpy" Title="ILSpy"
@ -51,7 +51,8 @@
<DockPanel> <DockPanel>
<!-- Main menu --> <!-- Main menu -->
<Menu DockPanel.Dock="Top" Name="mainMenu" Height="23" KeyboardNavigation.TabNavigation="None"> <Menu DockPanel.Dock="Top" Name="mainMenu" Height="23" KeyboardNavigation.TabNavigation="None">
<MenuItem Header="{x:Static properties:Resources._File}" /> <!-- contents of file menu are added using MEF --> <MenuItem Header="{x:Static properties:Resources._File}" />
<!-- contents of file menu are added using MEF -->
<MenuItem Header="{x:Static properties:Resources._View}"> <MenuItem Header="{x:Static properties:Resources._View}">
<MenuItem Header="{x:Static properties:Resources.Show_publiconlyTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisPublicOnly}" /> <MenuItem Header="{x:Static properties:Resources.Show_publiconlyTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisPublicOnly}" />
<MenuItem Header="{x:Static properties:Resources.Show_internalTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisPublicAndInternal}" /> <MenuItem Header="{x:Static properties:Resources.Show_internalTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisPublicAndInternal}" />
@ -107,99 +108,94 @@
</StatusBarItem> </StatusBarItem>
</StatusBar> </StatusBar>
<!-- Main grid separating left pane (treeView) from main pane (textEditor) --> <!-- Main grid separating left pane (treeView) from main pane (textEditor) -->
<Grid>
<Grid.ColumnDefinitions> <avalondock:DockingManager x:Name="DockManager"
<ColumnDefinition AllowMixedOrientation="True" Grid.ColumnSpan="2">
Name="leftColumn"
MinWidth="100" <avalondock:LayoutRoot x:Name="LayoutRoot" >
Width="0.4*" /> <avalondock:LayoutPanel Orientation="Vertical">
<ColumnDefinition <avalondock:LayoutPanel Orientation="Horizontal">
Width="3" /> <avalondock:LayoutAnchorablePaneGroup DockWidth="100" Orientation="Vertical">
<ColumnDefinition <avalondock:LayoutAnchorablePane DockHeight="*">
Name="rightColumn" <avalondock:LayoutAnchorable x:Name="Tree" Title="Project Explorer">
MinWidth="100" <!-- Left pane: Tree View of assemblies and classes -->
Width="0.6*" /> <tv:SharpTreeView
</Grid.ColumnDefinitions> Name="treeView"
<Grid.RowDefinitions> AutomationProperties.Name="Assemblies and Classes"
<RowDefinition SelectionChanged="TreeView_SelectionChanged"
Height="*" /> ShowRoot="False"
</Grid.RowDefinitions> AllowDropOrder="True"
<!-- Left pane: Tree View of assemblies and classes --> AllowDrop="True"
<tv:SharpTreeView BorderThickness="0,1,1,1" Visibility="Visible" />
Name="treeView" </avalondock:LayoutAnchorable>
AutomationProperties.Name="Assemblies and Classes" </avalondock:LayoutAnchorablePane>
SelectionChanged="TreeView_SelectionChanged" </avalondock:LayoutAnchorablePaneGroup>
ShowRoot="False"
AllowDropOrder="True" <avalondock:LayoutDocumentPaneGroup>
AllowDrop="True" <avalondock:LayoutDocumentPane x:Name="adDocumentPane">
BorderThickness="0,1,1,1" Visibility="Visible" /> <avalondock:LayoutDocument>
<GridSplitter <Grid>
Grid.ZIndex="1" <Grid.ColumnDefinitions>
Grid.Column="1" <ColumnDefinition Width="*" />
Margin="-5,0" </Grid.ColumnDefinitions>
BorderThickness="5,0" <Grid.RowDefinitions>
HorizontalAlignment="Center" <RowDefinition Height="Auto" />
VerticalAlignment="Stretch" <RowDefinition Height="0" Name="topPaneRow" />
Focusable="False" <RowDefinition Height="0" />
BorderBrush="Transparent" /> <RowDefinition Height="0.7*" MinHeight="100" Name="textViewRow" />
<!-- Right pane: Text Editor --> <RowDefinition Height="0" />
<Grid Grid.Column="2"> <RowDefinition Height="0" Name="bottomPaneRow" />
<Grid.ColumnDefinitions> </Grid.RowDefinitions>
<ColumnDefinition <Border BorderBrush="Black" BorderThickness="1" Name="updatePanel" Visibility="Collapsed">
Width="*" /> <DockPanel KeyboardNavigation.TabNavigation="Contained">
</Grid.ColumnDefinitions> <Button DockPanel.Dock="Right" Click="updatePanelCloseButtonClick" MinWidth="0">X</Button>
<Grid.RowDefinitions> <StackPanel Orientation="Horizontal">
<RowDefinition Height="Auto" /> <TextBlock Name="updatePanelMessage" Margin="4,0" VerticalAlignment="Center" Text="{x:Static properties:Resources.ILSpyVersionAvailable}" />
<RowDefinition Height="0" Name="topPaneRow" /> <Button Name="downloadOrCheckUpdateButton" Click="downloadOrCheckUpdateButtonClick" Content="{x:Static properties:Resources.Download}"/>
<RowDefinition Height="0" /> </StackPanel>
<RowDefinition Height="0.7*" MinHeight="100" Name="textViewRow" /> </DockPanel>
<RowDefinition Height="0" /> </Border>
<RowDefinition Height="0" Name="bottomPaneRow" />
</Grid.RowDefinitions> <controls:DockedPane x:Name="topPane" Grid.Row="1" Title="Top" Visibility="Collapsed"
<Border BorderBrush="Black" BorderThickness="1" Name="updatePanel" Visibility="Collapsed"> AutomationProperties.Name="Close top pane"
<DockPanel KeyboardNavigation.TabNavigation="Contained"> CloseButtonClicked="TopPane_CloseButtonClicked" Margin="0,0,0,3"
<Button DockPanel.Dock="Right" Click="updatePanelCloseButtonClick" MinWidth="0">X</Button> BorderThickness="1,1,0,1" />
<StackPanel Orientation="Horizontal">
<TextBlock Name="updatePanelMessage" Margin="4,0" VerticalAlignment="Center" Text="{x:Static properties:Resources.ILSpyVersionAvailable}" /> <GridSplitter
<Button Name="downloadOrCheckUpdateButton" Click="downloadOrCheckUpdateButtonClick" Content="{x:Static properties:Resources.Download}"/> Grid.ZIndex="1"
</StackPanel> Grid.Row="2"
</DockPanel> Margin="0,-2,0,-5"
</Border> BorderThickness="0,2,0,5"
BorderBrush="Transparent"
<controls:DockedPane x:Name="topPane" Grid.Row="1" Title="Top" Visibility="Collapsed" HorizontalAlignment="Stretch"
AutomationProperties.Name="Close top pane" VerticalAlignment="Center"
CloseButtonClicked="TopPane_CloseButtonClicked" Margin="0,0,0,3" Focusable="False"
BorderThickness="1,1,0,1" /> Visibility="{Binding Visibility, ElementName=topPane}" />
<GridSplitter <!-- decompilerTextView is into the mainPane by code -->
Grid.ZIndex="1" <ContentPresenter Name="mainPane" Grid.Row="3"/>
Grid.Row="2"
Margin="0,-2,0,-5" <GridSplitter
BorderThickness="0,2,0,5" Grid.ZIndex="1"
BorderBrush="Transparent" Grid.Row="4"
HorizontalAlignment="Stretch" Margin="0,-2,0,-5"
VerticalAlignment="Center" BorderThickness="0,2,0,5"
Focusable="False" BorderBrush="Transparent"
Visibility="{Binding Visibility, ElementName=topPane}" /> HorizontalAlignment="Stretch"
VerticalAlignment="Center"
<!-- decompilerTextView is into the mainPane by code --> Focusable="False"
<ContentPresenter Name="mainPane" Grid.Row="3"/> Visibility="{Binding Visibility, ElementName=bottomPane}" />
<GridSplitter <controls:DockedPane x:Name="bottomPane" Grid.Row="5" Title="Bottom" Visibility="Collapsed"
Grid.ZIndex="1" AutomationProperties.Name="Close"
Grid.Row="4" CloseButtonClicked="BottomPane_CloseButtonClicked" Margin="0,3,0,0" BorderThickness="1,1,0,1"/>
Margin="0,-2,0,-5" </Grid>
BorderThickness="0,2,0,5" </avalondock:LayoutDocument>
BorderBrush="Transparent" </avalondock:LayoutDocumentPane>
HorizontalAlignment="Stretch" </avalondock:LayoutDocumentPaneGroup>
VerticalAlignment="Center" </avalondock:LayoutPanel>
Focusable="False" </avalondock:LayoutPanel>
Visibility="{Binding Visibility, ElementName=bottomPane}" /> </avalondock:LayoutRoot>
</avalondock:DockingManager>
<controls:DockedPane x:Name="bottomPane" Grid.Row="5" Title="Bottom" Visibility="Collapsed"
AutomationProperties.Name="Close"
CloseButtonClicked="BottomPane_CloseButtonClicked" Margin="0,3,0,0" BorderThickness="1,1,0,1"/>
</Grid>
</Grid>
</DockPanel> </DockPanel>
</Window> </Window>

12
ILSpy/MainWindow.xaml.cs

@ -90,10 +90,11 @@ namespace ICSharpCode.ILSpy
decompilerTextView = App.ExportProvider.GetExportedValue<DecompilerTextView>(); decompilerTextView = App.ExportProvider.GetExportedValue<DecompilerTextView>();
mainPane.Content = decompilerTextView; mainPane.Content = decompilerTextView;
if (sessionSettings.SplitterPosition > 0 && sessionSettings.SplitterPosition < 1) { //todo
leftColumn.Width = new GridLength(sessionSettings.SplitterPosition, GridUnitType.Star); //if (sessionSettings.SplitterPosition > 0 && sessionSettings.SplitterPosition < 1) {
rightColumn.Width = new GridLength(1 - sessionSettings.SplitterPosition, GridUnitType.Star); // leftColumn.Width = new GridLength(sessionSettings.SplitterPosition, GridUnitType.Star);
} // rightColumn.Width = new GridLength(1 - sessionSettings.SplitterPosition, GridUnitType.Star);
//}
sessionSettings.FilterSettings.PropertyChanged += filterSettings_PropertyChanged; sessionSettings.FilterSettings.PropertyChanged += filterSettings_PropertyChanged;
InitMainMenu(); InitMainMenu();
@ -1022,7 +1023,8 @@ namespace ICSharpCode.ILSpy
sessionSettings.ActiveTreeViewPath = GetPathForNode(treeView.SelectedItem as SharpTreeNode); sessionSettings.ActiveTreeViewPath = GetPathForNode(treeView.SelectedItem as SharpTreeNode);
sessionSettings.ActiveAutoLoadedAssembly = GetAutoLoadedAssemblyNode(treeView.SelectedItem as SharpTreeNode); sessionSettings.ActiveAutoLoadedAssembly = GetAutoLoadedAssemblyNode(treeView.SelectedItem as SharpTreeNode);
sessionSettings.WindowBounds = this.RestoreBounds; sessionSettings.WindowBounds = this.RestoreBounds;
sessionSettings.SplitterPosition = leftColumn.Width.Value / (leftColumn.Width.Value + rightColumn.Width.Value); //todo
//sessionSettings.SplitterPosition = leftColumn.Width.Value / (leftColumn.Width.Value + rightColumn.Width.Value);
if (topPane.Visibility == Visibility.Visible) if (topPane.Visibility == Visibility.Visible)
sessionSettings.TopPaneSplitterPosition = topPaneRow.Height.Value / (topPaneRow.Height.Value + textViewRow.Height.Value); sessionSettings.TopPaneSplitterPosition = topPaneRow.Height.Value / (topPaneRow.Height.Value + textViewRow.Height.Value);
if (bottomPane.Visibility == Visibility.Visible) if (bottomPane.Visibility == Visibility.Visible)

Loading…
Cancel
Save