Browse Source

replace DockPanel with Grid and add a GridSplitter to allow Analyzer to be resized + other cleanup

pull/70/head
Siegfried Pammer 15 years ago
parent
commit
ead42305f8
  1. 29
      ILSpy/MainWindow.xaml
  2. 6
      ILSpy/MainWindow.xaml.cs
  3. 20
      ILSpy/TreeNodes/Analyzer/AnalyzedMethodTreeNode.cs

29
ILSpy/MainWindow.xaml

@ -144,10 +144,13 @@ @@ -144,10 +144,13 @@
BorderBrush="Transparent"
HorizontalAlignment="Stretch" />
<!-- Right pane: Text Editor -->
<DockPanel
Grid.Column="2">
<Border BorderBrush="Black" BorderThickness="1" DockPanel.Dock="Top" Name="updateAvailablePanel" Visibility="Collapsed">
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border BorderBrush="Black" BorderThickness="1" Name="updateAvailablePanel" Visibility="Collapsed">
<DockPanel>
<Button DockPanel.Dock="Right" Click="updateAvailablePanelCloseButtonClick" MinWidth="0">X</Button>
<StackPanel Orientation="Horizontal">
@ -157,15 +160,25 @@ @@ -157,15 +160,25 @@
</DockPanel>
</Border>
<Border BorderBrush="Gray" BorderThickness="1" DockPanel.Dock="Bottom" Name="analyzerPanel" Visibility="{Binding IsChecked, ElementName=showAnalyzer, Converter={StaticResource BooleanToVisibilityConverter}}" MinHeight="100" MaxHeight="300">
<textView:DecompilerTextView x:Name="decompilerTextView" Grid.Row="1" />
<GridSplitter
Grid.ZIndex="2"
Grid.Row="1"
Margin="0,-2"
BorderThickness="0,2"
BorderBrush="Transparent"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Visibility="{Binding IsChecked, ElementName=showAnalyzer, Converter={StaticResource BooleanToVisibilityConverter}}" />
<Border BorderBrush="Gray" BorderThickness="1" Grid.Row="2" Name="analyzerPanel" Visibility="{Binding IsChecked, ElementName=showAnalyzer, Converter={StaticResource BooleanToVisibilityConverter}}" MinHeight="100">
<DockPanel>
<Label DockPanel.Dock="Top">Analyzer</Label>
<tv:SharpTreeView Name="analyzerTree" ShowRoot="False" />
</DockPanel>
</Border>
<textView:DecompilerTextView x:Name="decompilerTextView" />
</DockPanel>
</Grid>
</Grid>
</DockPanel>
</Window>

6
ILSpy/MainWindow.xaml.cs

@ -389,12 +389,10 @@ namespace ICSharpCode.ILSpy @@ -389,12 +389,10 @@ namespace ICSharpCode.ILSpy
analyzerPanel.Visibility = Visibility.Visible;
var newNode = new AnalyzedMethodTreeNode(method.MethodDefinition) {
Language = sessionSettings.FilterSettings.Language
Language = sessionSettings.FilterSettings.Language,
IsExpanded = true
};
if (analyzerTree.Root.Children.Contains(newNode))
analyzerTree.Root.Children.Remove(newNode);
analyzerTree.Root.Children.Add(newNode);
}
#endregion

20
ILSpy/TreeNodes/Analyzer/AnalyzedMethodTreeNode.cs

@ -45,25 +45,5 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer @@ -45,25 +45,5 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer
{
this.Children.Add(new AnalyzedMethodUsedByTreeNode(analyzedMethod));
}
#region Equals and GetHashCode implementation
public override bool Equals(object obj)
{
AnalyzedMethodTreeNode other = obj as AnalyzedMethodTreeNode;
if (other == null)
return false;
return object.Equals(this.analyzedMethod, other.analyzedMethod);
}
public override int GetHashCode()
{
int hashCode = 0;
unchecked {
if (analyzedMethod != null)
hashCode += 1000000007 * analyzedMethod.GetHashCode();
}
return hashCode;
}
#endregion
}
}

Loading…
Cancel
Save