Browse Source

Removed a few private setters and modernized a few argument checks

pull/3048/head
Lehonti Ramos 2 years ago
parent
commit
cfbade8508
  1. 2
      ILSpy/DecompilationOptions.cs
  2. 4
      ILSpy/NavigationState.cs
  3. 2
      ILSpy/SessionSettings.cs
  4. 10
      ILSpy/TextView/BracketHighlightRenderer.cs
  5. 2
      ILSpy/TextView/DocumentationUIBuilder.cs
  6. 6
      ILSpy/TreeNodes/ResourceNodes/ResourcesFileTreeNode.cs

2
ILSpy/DecompilationOptions.cs

@ -67,7 +67,7 @@ namespace ICSharpCode.ILSpy @@ -67,7 +67,7 @@ namespace ICSharpCode.ILSpy
/// <summary>
/// Gets the settings for the decompiler.
/// </summary>
public Decompiler.DecompilerSettings DecompilerSettings { get; private set; }
public Decompiler.DecompilerSettings DecompilerSettings { get; }
/// <summary>
/// Gets/sets an optional state of a decompiler text view.

4
ILSpy/NavigationState.cs

@ -32,8 +32,8 @@ namespace ICSharpCode.ILSpy @@ -32,8 +32,8 @@ namespace ICSharpCode.ILSpy
private readonly HashSet<SharpTreeNode> treeNodes;
public IEnumerable<SharpTreeNode> TreeNodes => treeNodes;
public ViewState ViewState { get; private set; }
public TabPageModel TabPage { get; private set; }
public ViewState ViewState { get; }
public TabPageModel TabPage { get; }
public NavigationState(TabPageModel tabPage, ViewState viewState)
{

2
ILSpy/SessionSettings.cs

@ -125,7 +125,7 @@ namespace ICSharpCode.ILSpy @@ -125,7 +125,7 @@ namespace ICSharpCode.ILSpy
public double SplitterPosition;
public double TopPaneSplitterPosition, BottomPaneSplitterPosition;
public DockLayoutSettings DockLayout { get; private set; }
public DockLayoutSettings DockLayout { get; }
public XElement ToXml()
{

10
ILSpy/TextView/BracketHighlightRenderer.cs

@ -51,13 +51,13 @@ namespace ICSharpCode.ILSpy.TextView @@ -51,13 +51,13 @@ namespace ICSharpCode.ILSpy.TextView
/// </summary>
public class BracketSearchResult
{
public int OpeningBracketOffset { get; private set; }
public int OpeningBracketOffset { get; }
public int OpeningBracketLength { get; private set; }
public int OpeningBracketLength { get; }
public int ClosingBracketOffset { get; private set; }
public int ClosingBracketOffset { get; }
public int ClosingBracketLength { get; private set; }
public int ClosingBracketLength { get; }
public BracketSearchResult(int openingBracketOffset, int openingBracketLength,
int closingBracketOffset, int closingBracketLength)
@ -90,7 +90,7 @@ namespace ICSharpCode.ILSpy.TextView @@ -90,7 +90,7 @@ namespace ICSharpCode.ILSpy.TextView
public BracketHighlightRenderer(ICSharpCode.AvalonEdit.Rendering.TextView textView)
{
if (textView == null)
throw new ArgumentNullException("textView");
throw new ArgumentNullException(nameof(textView));
this.borderPen = (Pen)textView.FindResource(Themes.ResourceKeys.BracketHighlightBorderPen);
this.backgroundBrush = (SolidColorBrush)textView.FindResource(Themes.ResourceKeys.BracketHighlightBackgroundBrush);

2
ILSpy/TextView/DocumentationUIBuilder.cs

@ -145,7 +145,7 @@ namespace ICSharpCode.ILSpy.TextView @@ -145,7 +145,7 @@ namespace ICSharpCode.ILSpy.TextView
public void AddDocumentationElement(XmlDocumentationElement element)
{
if (element == null)
throw new ArgumentNullException("element");
throw new ArgumentNullException(nameof(element));
if (element.IsTextNode)
{
AddText(element.TextContent);

6
ILSpy/TreeNodes/ResourceNodes/ResourcesFileTreeNode.cs

@ -214,9 +214,9 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -214,9 +214,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
this.Value = value;
}
public string Key { get; private set; }
public string Type { get; private set; }
public string Value { get; private set; }
public string Key { get; }
public string Type { get; }
public string Value { get; }
}
}
}

Loading…
Cancel
Save