Browse Source

Fix whitespace

pull/3642/head
Lex Li 2 days ago
parent
commit
d5830147fd
  1. 12
      ILSpy/AssemblyTree/AssemblyTreeModel.cs
  2. 6
      ILSpy/Metadata/Helper.wpf.cs
  3. 16
      ILSpy/Metadata/Helpers.cs
  4. 2
      ILSpy/Metadata/HexFilterControl.ContentFilter.cs
  5. 6
      ILSpy/Metadata/MetadataTableTreeNode.wpf.cs
  6. 6
      ILSpy/Options/ShowOptionsCommand.cs

12
ILSpy/AssemblyTree/AssemblyTreeModel.cs

@ -130,9 +130,9 @@ namespace ICSharpCode.ILSpy.AssemblyTree
var oldSelection = selectedItems; var oldSelection = selectedItems;
selectedItems = value; selectedItems = value;
OnPropertyChanged(); OnPropertyChanged();
#if CROSS_PLATFORM #if CROSS_PLATFORM
OnPropertyChanged(nameof(SelectedItem)); OnPropertyChanged(nameof(SelectedItem));
#endif #endif
TreeView_SelectionChanged(oldSelection, selectedItems); TreeView_SelectionChanged(oldSelection, selectedItems);
} }
} }
@ -496,16 +496,16 @@ namespace ICSharpCode.ILSpy.AssemblyTree
} }
else else
{ {
#if CROSS_PLATFORM #if CROSS_PLATFORM
ExpandAncestors(node); ExpandAncestors(node);
#endif #endif
activeView?.ScrollIntoView(node); activeView?.ScrollIntoView(node);
SelectedItem = node; SelectedItem = node;
UIThreadDispatcher.BeginInvoke(DispatcherPriority.Background, () => { UIThreadDispatcher.BeginInvoke(DispatcherPriority.Background, () => {
#if CROSS_PLATFORM #if CROSS_PLATFORM
SelectedItem = node; SelectedItem = node;
#endif #endif
activeView?.ScrollIntoView(node); activeView?.ScrollIntoView(node);
}); });
} }

6
ILSpy/Metadata/Helper.wpf.cs

@ -8,8 +8,8 @@ using System.Windows.Documents;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
{ {
static partial class Helpers static partial class Helpers
{ {
private static DataTemplate GetOrCreateLinkCellTemplate(string name, PropertyDescriptor descriptor, Binding binding) private static DataTemplate GetOrCreateLinkCellTemplate(string name, PropertyDescriptor descriptor, Binding binding)
{ {
if (linkCellTemplates.TryGetValue(name, out var template)) if (linkCellTemplates.TryGetValue(name, out var template))
@ -39,5 +39,5 @@ namespace ICSharpCode.ILSpy.Metadata
} }
} }
} }
} }
} }

16
ILSpy/Metadata/Helpers.cs

@ -71,9 +71,9 @@ namespace ICSharpCode.ILSpy.Metadata
ContextMenuProvider.Add(view); ContextMenuProvider.Add(view);
DataGridFilter.SetIsAutoFilterEnabled(view, true); DataGridFilter.SetIsAutoFilterEnabled(view, true);
DataGridFilter.SetContentFilterFactory(view, new RegexContentFilterFactory()); DataGridFilter.SetContentFilterFactory(view, new RegexContentFilterFactory());
#if !CROSS_PLATFORM #if !CROSS_PLATFORM
AdvancedScrollWheelBehavior.SetAttach(view, AdvancedScrollWheelMode.WithoutAnimation); AdvancedScrollWheelBehavior.SetAttach(view, AdvancedScrollWheelMode.WithoutAnimation);
#endif #endif
} }
DataGridFilter.GetFilter(view).Clear(); DataGridFilter.GetFilter(view).Clear();
view.RowDetailsTemplateSelector = null; view.RowDetailsTemplateSelector = null;
@ -112,23 +112,23 @@ namespace ICSharpCode.ILSpy.Metadata
case "RVA": case "RVA":
case "StartOffset": case "StartOffset":
case "Length": case "Length":
#if CROSS_PLATFORM #if CROSS_PLATFORM
binding.Converter = HexFormatConverter.Instance; binding.Converter = HexFormatConverter.Instance;
#else #else
binding.StringFormat = "X8"; binding.StringFormat = "X8";
#endif #endif
e.Column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["HexFilter"]); e.Column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["HexFilter"]);
break; break;
case "RowDetails": case "RowDetails":
e.Cancel = true; e.Cancel = true;
break; break;
case "Value" when e.PropertyDescriptor is PropertyDescriptor dp && dp.ComponentType == typeof(Entry): case "Value" when e.PropertyDescriptor is PropertyDescriptor dp && dp.ComponentType == typeof(Entry):
#if CROSS_PLATFORM #if CROSS_PLATFORM
binding.Path = "."; binding.Path = ".";
e.Column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["DefaultFilter"]); e.Column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["DefaultFilter"]);
#else #else
binding.Path = new PropertyPath("."); binding.Path = new PropertyPath(".");
#endif #endif
binding.Converter = ByteWidthConverter.Instance; binding.Converter = ByteWidthConverter.Instance;
break; break;
default: default:

2
ILSpy/Metadata/HexFilterControl.ContentFilter.cs

@ -4,7 +4,7 @@ using DataGridExtensions;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
{ {
public partial class HexFilterControl public partial class HexFilterControl
{ {
class ContentFilter : IContentFilter class ContentFilter : IContentFilter
{ {

6
ILSpy/Metadata/MetadataTableTreeNode.wpf.cs

@ -3,8 +3,8 @@ using System.Windows.Threading;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
{ {
partial class MetadataTableTreeNode partial class MetadataTableTreeNode
{ {
protected void ScrollRowIntoView(DataGrid view, int row) protected void ScrollRowIntoView(DataGrid view, int row)
{ {
@ -28,5 +28,5 @@ namespace ICSharpCode.ILSpy.Metadata
view.Loaded -= View_Loaded; view.Loaded -= View_Loaded;
this.scrollTarget = default; this.scrollTarget = default;
} }
} }
} }

6
ILSpy/Options/ShowOptionsCommand.cs

@ -32,7 +32,7 @@ namespace ICSharpCode.ILSpy.Options
{ {
OptionsDialog dlg = new(settingsService); OptionsDialog dlg = new(settingsService);
#if CROSS_PLATFORM #if CROSS_PLATFORM
// On cross-platform schedule showing the dialog on the UI dispatcher // On cross-platform schedule showing the dialog on the UI dispatcher
// and await its result asynchronously. Do not block the calling thread. // and await its result asynchronously. Do not block the calling thread.
System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(async () => { System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(async () => {
@ -42,7 +42,7 @@ namespace ICSharpCode.ILSpy.Options
System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(() => assemblyTreeModel.Refresh()); System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(() => assemblyTreeModel.Refresh());
} }
}); });
#else #else
// WPF path: set owner and show dialog synchronously as before. // WPF path: set owner and show dialog synchronously as before.
dlg.Owner = mainWindow; dlg.Owner = mainWindow;
bool? result = dlg.ShowDialog(); bool? result = dlg.ShowDialog();
@ -50,7 +50,7 @@ namespace ICSharpCode.ILSpy.Options
{ {
assemblyTreeModel.Refresh(); assemblyTreeModel.Refresh();
} }
#endif #endif
} }
} }
} }
Loading…
Cancel
Save