Skip to content

Commit

Permalink
fix build errors from merge
Browse files Browse the repository at this point in the history
  • Loading branch information
apmoskevitz committed Sep 23, 2024
1 parent 0aad136 commit 6312e59
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 43 deletions.
8 changes: 3 additions & 5 deletions ILSpy/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@

using System;
using System.Collections.Generic;
using System.ComponentModel.Composition.Hosting;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Loader;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Documents;
Expand All @@ -33,8 +34,8 @@

using ICSharpCode.ILSpy.AppEnv;
using ICSharpCode.ILSpy.AssemblyTree;
using ICSharpCode.ILSpy.Themes;
using ICSharpCode.ILSpyX.Analyzers;
using ICSharpCode.ILSpyX.Settings;
using ICSharpCode.ILSpyX.TreeView;

using Medo.Application;
Expand All @@ -43,9 +44,6 @@

using TomsToolbox.Composition;
using TomsToolbox.Wpf.Composition;
using ICSharpCode.ILSpy.Themes;
using System.Globalization;
using System.Threading;
using TomsToolbox.Wpf.Styles;

namespace ICSharpCode.ILSpy
Expand Down
52 changes: 25 additions & 27 deletions ILSpy/AssemblyTree/AssemblyTreeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,38 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Navigation;
using System.Windows.Threading;

using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Documentation;
using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.Decompiler.TypeSystem.Implementation;
using ICSharpCode.ILSpy.AppEnv;
using ICSharpCode.ILSpy.Docking;
using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpy.Search;
using ICSharpCode.ILSpy.TextView;
using ICSharpCode.ILSpy.TreeNodes;
using ICSharpCode.ILSpy.ViewModels;
using ICSharpCode.ILSpyX;
using ICSharpCode.ILSpyX.Settings;
using ICSharpCode.ILSpyX.TreeView;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using ICSharpCode.Decompiler.Metadata;

using System.Reflection.Metadata.Ecma335;
using System.Windows;
using ICSharpCode.Decompiler.Documentation;
using ICSharpCode.Decompiler.TypeSystem.Implementation;
using System.Reflection.Metadata;
using System.Text;
using System.Windows.Navigation;

using ICSharpCode.ILSpy.AppEnv;
using ICSharpCode.ILSpy.Search;
using ICSharpCode.Decompiler;

using TomsToolbox.Essentials;
using TomsToolbox.Wpf;
Expand Down Expand Up @@ -121,8 +119,8 @@ public SharpTreeNode Root {
set => SetProperty(ref root, value);
}

private SharpTreeNode selectedItem;
public SharpTreeNode SelectedItem {
private SharpTreeNode? selectedItem;
public SharpTreeNode? SelectedItem {
get => selectedItem;
set => SetProperty(ref selectedItem, value);
}
Expand All @@ -145,7 +143,7 @@ public bool HandleCommandLineArguments(CommandLineArguments args)
/// Called on startup or when passed arguments via WndProc from a second instance.
/// In the format case, spySettings is non-null; in the latter it is null.
/// </summary>
public void HandleCommandLineArgumentsAfterShowList(CommandLineArguments args, ISettingsProvider spySettings = null)
public void HandleCommandLineArgumentsAfterShowList(CommandLineArguments args, ISettingsProvider? spySettings = null)
{
var sessionSettings = SettingsService.Instance.SessionSettings;

Expand Down Expand Up @@ -432,7 +430,7 @@ void ShowAssemblyList(AssemblyList assemblyList)
#endif
}

void assemblyList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
void assemblyList_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Reset)
{
Expand Down Expand Up @@ -595,7 +593,7 @@ public ILSpyTreeNode FindTreeNode(object reference)
}
}

private void JumpToReference(object sender, NavigateToReferenceEventArgs e)
private void JumpToReference(object? sender, NavigateToReferenceEventArgs e)
{
JumpToReferenceAsync(e.Reference, e.InNewTabPage).HandleExceptions();
}
Expand Down Expand Up @@ -655,11 +653,11 @@ private Task JumpToReferenceAsync(object reference, bool inNewTabPage = false)

#endregion

public void LoadAssemblies(IEnumerable<string> fileNames, List<LoadedAssembly> loadedAssemblies = null, bool focusNode = true)
public void LoadAssemblies(IEnumerable<string> fileNames, List<LoadedAssembly>? loadedAssemblies = null, bool focusNode = true)
{
using (Keyboard.FocusedElement.PreserveFocus(!focusNode))
{
AssemblyTreeNode lastNode = null;
AssemblyTreeNode? lastNode = null;

foreach (string file in fileNames)
{
Expand Down Expand Up @@ -717,7 +715,7 @@ void TreeView_SelectionChanged()

return;

void ContextMenuClosed(object sender, EventArgs e)
void ContextMenuClosed(object? sender, EventArgs e)
{
ContextMenuProvider.ContextMenuClosed -= ContextMenuClosed;

Expand All @@ -730,7 +728,7 @@ void ContextMenuClosed(object sender, EventArgs e)
}
}

private void DecompileSelectedNodes(DecompilerTextViewState newState = null)
private void DecompileSelectedNodes(DecompilerTextViewState? newState = null)
{
var activeTabPage = DockWorkspace.Instance.ActiveTabPage;

Expand Down Expand Up @@ -882,7 +880,7 @@ public void SortAssemblyList()
private class AssemblyComparer : IComparer<LoadedAssembly>
{
public static readonly AssemblyComparer Instance = new();
int IComparer<LoadedAssembly>.Compare(LoadedAssembly x, LoadedAssembly y)
int IComparer<LoadedAssembly>.Compare(LoadedAssembly? x, LoadedAssembly? y)
{
return string.Compare(x?.ShortName, y?.ShortName, StringComparison.CurrentCulture);
}
Expand Down
2 changes: 1 addition & 1 deletion ILSpy/ContextMenuEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class TextViewContext
/// </summary>
public DependencyObject OriginalSource { get; private set; }

public static TextViewContext Create(ContextMenuEventArgs eventArgs, SharpTreeView?? treeView = null, DecompilerTextView textView = null, ListBox? listBox = null, DataGrid? dataGrid = null)
public static TextViewContext Create(ContextMenuEventArgs eventArgs, SharpTreeView? treeView = null, DecompilerTextView? textView = null, ListBox? listBox = null, DataGrid? dataGrid = null)
{
ReferenceSegment? reference;

Expand Down
2 changes: 1 addition & 1 deletion ILSpy/Docking/DockWorkspace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private void TabPages_CollectionChanged(object? sender, NotifyCollectionChangedE
}
}

public void AddTabPage(TabPageModel tabPage = null)
public void AddTabPage(TabPageModel? tabPage = null)
{
tabPages.Add(tabPage ?? new TabPageModel());
}
Expand Down
1 change: 0 additions & 1 deletion ILSpy/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
using AvalonDock.Layout.Serialization;

using ICSharpCode.ILSpy.AssemblyTree;
using ICSharpCode.ILSpy.Docking;
using ICSharpCode.ILSpy.TreeNodes;
using ICSharpCode.ILSpy.Updates;
using ICSharpCode.ILSpyX.FileLoaders;
Expand Down
4 changes: 2 additions & 2 deletions ILSpy/Options/DisplaySettingsPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static void OnPaste(object sender, DataObjectPastingEventArgs e)

public sealed class FontSizeConverter : ValueConverter
{
protected override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
protected override object Convert(object value, Type? targetType, object? parameter, System.Globalization.CultureInfo? culture)
{
if (value is double d)
{
Expand All @@ -79,7 +79,7 @@ protected override object Convert(object value, Type targetType, object paramete
return DependencyProperty.UnsetValue;
}

protected override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
protected override object ConvertBack(object value, Type? targetType, object? parameter, System.Globalization.CultureInfo? culture)
{
if (value is not string s)
return DependencyProperty.UnsetValue;
Expand Down
2 changes: 1 addition & 1 deletion ILSpy/Options/OptionsDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ShowOptionsCommand(AssemblyTreeModel assemblyTreeModel)
this.assemblyTreeModel = assemblyTreeModel;
}

public override void Execute(object parameter)
public override void Execute(object? parameter)
{
OptionsDialog dlg = new() {
Owner = MainWindow.Instance,
Expand Down
6 changes: 3 additions & 3 deletions ILSpy/SessionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,14 @@ static string ToString<T>(T obj)
return c.ConvertToInvariantString(obj);
}

public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangedEventHandler? PropertyChanged;

private void OnPropertyChanged([CallerMemberName] string propertyName = null)
private void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new(propertyName));
}

private bool SetProperty<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
private bool SetProperty<T>(ref T field, T value, [CallerMemberName] string? propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value))
return false;
Expand Down
4 changes: 2 additions & 2 deletions ILSpy/Views/DebugSteps.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ private void WritingOptions_PropertyChanged(object? sender, System.ComponentMode
DecompileAsync(lastSelectedStep);
}

private void SelectionChanged(object sender, EventArgs e)
private void SelectionChanged(object? sender, EventArgs e)
{
Dispatcher.Invoke(() => {
tree.ItemsSource = null;
lastSelectedStep = int.MaxValue;
});
}

private void Settings_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
private void Settings_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
#if DEBUG
if (sender is not LanguageSettings)
Expand Down

0 comments on commit 6312e59

Please sign in to comment.