Browse Source

Fix #1804: ArgumentException when clicking on ResourcesFileTreeNode.

Removed unused UI elements.
pull/1820/head
Siegfried Pammer 6 years ago
parent
commit
40a9aa4ce0
  1. 8
      ILSpy/Controls/ResourceObjectTable.xaml.cs
  2. 8
      ILSpy/Controls/ResourceStringTable.xaml.cs
  3. 2
      ILSpy/MainWindow.xaml
  4. 6
      ILSpy/MainWindow.xaml.cs
  5. 4
      ILSpy/TreeNodes/ResourceNodes/ResourcesFileTreeNode.cs

8
ILSpy/Controls/ResourceObjectTable.xaml.cs

@ -29,13 +29,13 @@ namespace ICSharpCode.ILSpy.Controls @@ -29,13 +29,13 @@ namespace ICSharpCode.ILSpy.Controls
/// </summary>
public partial class ResourceObjectTable : UserControl
{
public ResourceObjectTable(IEnumerable resources, ContentPresenter contentPresenter)
public ResourceObjectTable(IEnumerable resources, FrameworkElement container)
{
InitializeComponent();
// set size to fit decompiler window
contentPresenter.SizeChanged += OnParentSizeChanged;
Width = contentPresenter.ActualWidth - 45;
MaxHeight = contentPresenter.ActualHeight;
container.SizeChanged += OnParentSizeChanged;
Width = container.ActualWidth - 45;
MaxHeight = container.ActualHeight;
resourceListView.ItemsSource = resources;
}

8
ILSpy/Controls/ResourceStringTable.xaml.cs

@ -29,13 +29,13 @@ namespace ICSharpCode.ILSpy.Controls @@ -29,13 +29,13 @@ namespace ICSharpCode.ILSpy.Controls
/// </summary>
public partial class ResourceStringTable : UserControl
{
public ResourceStringTable(IEnumerable strings, ContentPresenter contentPresenter)
public ResourceStringTable(IEnumerable strings, FrameworkElement container)
{
InitializeComponent();
// set size to fit decompiler window
contentPresenter.SizeChanged += OnParentSizeChanged;
Width = contentPresenter.ActualWidth - 45;
MaxHeight = contentPresenter.ActualHeight;
container.SizeChanged += OnParentSizeChanged;
Width = container.ActualWidth - 45;
MaxHeight = container.ActualHeight;
resourceListView.ItemsSource = strings;
}

2
ILSpy/MainWindow.xaml

@ -56,8 +56,6 @@ @@ -56,8 +56,6 @@
<ContentControl Content="{StaticResource AnalyzerTreeView}" />
</DataTemplate>
<ContentPresenter x:Key="MainPane" />
<DataTemplate x:Key="DecompilerTextViewTemplate">
<textview:DecompilerTextView DataContext="{Binding}" />
</DataTemplate>

6
ILSpy/MainWindow.xaml.cs

@ -83,12 +83,6 @@ namespace ICSharpCode.ILSpy @@ -83,12 +83,6 @@ namespace ICSharpCode.ILSpy
get { return sessionSettings; }
}
public ContentPresenter mainPane {
get {
return FindResource("MainPane") as ContentPresenter;
}
}
public SharpTreeView treeView {
get {
return FindResource("TreeView") as SharpTreeView;

4
ILSpy/TreeNodes/ResourceNodes/ResourcesFileTreeNode.cs

@ -149,7 +149,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -149,7 +149,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
if (null != smartOutput) {
smartOutput.AddUIElement(
delegate {
return new ResourceStringTable(stringTableEntries, MainWindow.Instance.mainPane);
return new ResourceStringTable(stringTableEntries, Docking.DockWorkspace.Instance.GetTextView());
}
);
}
@ -161,7 +161,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -161,7 +161,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
if (null != smartOutput) {
smartOutput.AddUIElement(
delegate {
return new ResourceObjectTable(otherEntries, MainWindow.Instance.mainPane);
return new ResourceObjectTable(otherEntries, Docking.DockWorkspace.Instance.GetTextView());
}
);
}

Loading…
Cancel
Save