diff --git a/ILSpy/App.xaml b/ILSpy/App.xaml index ce2e14086..1d00e1ee8 100644 --- a/ILSpy/App.xaml +++ b/ILSpy/App.xaml @@ -3,7 +3,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:styles="urn:TomsToolbox.Wpf.Styles" xmlns:toms="urn:TomsToolbox" - xmlns:themes="clr-namespace:ICSharpCode.ILSpy.Themes"> + xmlns:themes="clr-namespace:ICSharpCode.ILSpy.Themes" + xmlns:ilSpy="clr-namespace:ICSharpCode.ILSpy"> diff --git a/ILSpy/App.xaml.cs b/ILSpy/App.xaml.cs index c82af3125..eabe3bce2 100644 --- a/ILSpy/App.xaml.cs +++ b/ILSpy/App.xaml.cs @@ -59,6 +59,10 @@ namespace ICSharpCode.ILSpy public static IExportProvider ExportProvider { get; private set; } + private readonly SettingsService settingsService; + + public static SettingsService SettingsService => Current.settingsService; + internal record ExceptionData(Exception Exception) { public string PluginName { get; init; } @@ -69,7 +73,7 @@ namespace ICSharpCode.ILSpy var cmdArgs = Environment.GetCommandLineArgs().Skip(1); CommandLineArguments = CommandLineArguments.Create(cmdArgs); - var settingsService = new SettingsService(); + settingsService = new SettingsService(); bool forceSingleInstance = (CommandLineArguments.SingleInstance ?? true) && !settingsService.MiscSettings.AllowMultipleInstances; diff --git a/ILSpy/Controls/ZoomScrollViewer.xaml b/ILSpy/Controls/ZoomScrollViewer.xaml index 509b8d636..3bd4ace05 100644 --- a/ILSpy/Controls/ZoomScrollViewer.xaml +++ b/ILSpy/Controls/ZoomScrollViewer.xaml @@ -1,7 +1,8 @@  + xmlns:toms="urn:TomsToolbox" + xmlns:ilSpy="clr-namespace:ICSharpCode.ILSpy"> diff --git a/ILSpy/Options/DisplaySettings.cs b/ILSpy/Options/DisplaySettings.cs index 9eb07b394..8b21987bb 100644 --- a/ILSpy/Options/DisplaySettings.cs +++ b/ILSpy/Options/DisplaySettings.cs @@ -148,6 +148,12 @@ namespace ICSharpCode.ILSpy.Options set => SetProperty(ref showRawOffsetsAndBytesBeforeInstruction, value); } + private bool enableSmoothScrolling; + public bool EnableSmoothScrolling { + get => enableSmoothScrolling; + set => SetProperty(ref enableSmoothScrolling, value); + } + public XName SectionName => "DisplaySettings"; public void LoadFromXml(XElement section) @@ -172,6 +178,7 @@ namespace ICSharpCode.ILSpy.Options UseNestedNamespaceNodes = (bool?)section.Attribute("UseNestedNamespaceNodes") ?? false; ShowRawOffsetsAndBytesBeforeInstruction = (bool?)section.Attribute("ShowRawOffsetsAndBytesBeforeInstruction") ?? false; StyleWindowTitleBar = (bool?)section.Attribute("StyleWindowTitleBar") ?? false; + EnableSmoothScrolling = (bool?)section.Attribute("EnableSmoothScrolling") ?? true; } public XElement SaveToXml() @@ -198,6 +205,7 @@ namespace ICSharpCode.ILSpy.Options section.SetAttributeValue("UseNestedNamespaceNodes", UseNestedNamespaceNodes); section.SetAttributeValue("ShowRawOffsetsAndBytesBeforeInstruction", ShowRawOffsetsAndBytesBeforeInstruction); section.SetAttributeValue("StyleWindowTitleBar", StyleWindowTitleBar); + section.SetAttributeValue("EnableSmoothScrolling", EnableSmoothScrolling); return section; } diff --git a/ILSpy/Options/DisplaySettingsPanel.xaml b/ILSpy/Options/DisplaySettingsPanel.xaml index 9fb50d7a9..7df9a6b60 100644 --- a/ILSpy/Options/DisplaySettingsPanel.xaml +++ b/ILSpy/Options/DisplaySettingsPanel.xaml @@ -78,6 +78,7 @@ + diff --git a/ILSpy/Properties/Resources.Designer.cs b/ILSpy/Properties/Resources.Designer.cs index 01628056b..7e9235cae 100644 --- a/ILSpy/Properties/Resources.Designer.cs +++ b/ILSpy/Properties/Resources.Designer.cs @@ -1722,6 +1722,15 @@ namespace ICSharpCode.ILSpy.Properties { } } + /// + /// Looks up a localized string similar to Enable smooth scrolling. + /// + public static string EnableSmoothScrolling { + get { + return ResourceManager.GetString("EnableSmoothScrolling", resourceCulture); + } + } + /// /// Looks up a localized string similar to Enable word wrap. /// diff --git a/ILSpy/Properties/Resources.resx b/ILSpy/Properties/Resources.resx index bcb79fae7..a6e65ca67 100644 --- a/ILSpy/Properties/Resources.resx +++ b/ILSpy/Properties/Resources.resx @@ -591,6 +591,9 @@ Are you sure you want to continue? Enable folding on all blocks in braces + + Enable smooth scrolling + Enable word wrap