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. 62
      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" />

62
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,23 +108,16 @@
</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"
Width="0.6*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition
Height="*" />
</Grid.RowDefinitions>
<!-- Left pane: Tree View of assemblies and classes --> <!-- Left pane: Tree View of assemblies and classes -->
<tv:SharpTreeView <tv:SharpTreeView
Name="treeView" Name="treeView"
@ -133,20 +127,16 @@
AllowDropOrder="True" AllowDropOrder="True"
AllowDrop="True" AllowDrop="True"
BorderThickness="0,1,1,1" Visibility="Visible" /> BorderThickness="0,1,1,1" Visibility="Visible" />
<GridSplitter </avalondock:LayoutAnchorable>
Grid.ZIndex="1" </avalondock:LayoutAnchorablePane>
Grid.Column="1" </avalondock:LayoutAnchorablePaneGroup>
Margin="-5,0"
BorderThickness="5,0" <avalondock:LayoutDocumentPaneGroup>
HorizontalAlignment="Center" <avalondock:LayoutDocumentPane x:Name="adDocumentPane">
VerticalAlignment="Stretch" <avalondock:LayoutDocument>
Focusable="False" <Grid>
BorderBrush="Transparent" />
<!-- Right pane: Text Editor -->
<Grid Grid.Column="2">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition <ColumnDefinition Width="*" />
Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -200,6 +190,12 @@
AutomationProperties.Name="Close" AutomationProperties.Name="Close"
CloseButtonClicked="BottomPane_CloseButtonClicked" Margin="0,3,0,0" BorderThickness="1,1,0,1"/> CloseButtonClicked="BottomPane_CloseButtonClicked" Margin="0,3,0,0" BorderThickness="1,1,0,1"/>
</Grid> </Grid>
</Grid> </avalondock:LayoutDocument>
</avalondock:LayoutDocumentPane>
</avalondock:LayoutDocumentPaneGroup>
</avalondock:LayoutPanel>
</avalondock:LayoutPanel>
</avalondock:LayoutRoot>
</avalondock:DockingManager>
</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