Browse Source

Move ILAstWritingOptions to separate file

pull/923/head
Siegfried Pammer 8 years ago
parent
commit
312277119c
  1. 1
      ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
  2. 66
      ICSharpCode.Decompiler/IL/ILAstWritingOptions.cs
  3. 13
      ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs

1
ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj

@ -273,6 +273,7 @@
<Compile Include="DotNetCore\DotNetCorePathFinder.cs" /> <Compile Include="DotNetCore\DotNetCorePathFinder.cs" />
<Compile Include="DotNetCore\DotNetCorePathFinderExtensions.cs" /> <Compile Include="DotNetCore\DotNetCorePathFinderExtensions.cs" />
<Compile Include="DotNetCore\UnresolvedAssemblyNameReference.cs" /> <Compile Include="DotNetCore\UnresolvedAssemblyNameReference.cs" />
<Compile Include="IL\ILAstWritingOptions.cs" />
<Compile Include="IL\SequencePoint.cs" /> <Compile Include="IL\SequencePoint.cs" />
<Compile Include="IL\Instructions\CallIndirect.cs" /> <Compile Include="IL\Instructions\CallIndirect.cs" />
<Compile Include="IL\Transforms\EarlyExpressionTransforms.cs" /> <Compile Include="IL\Transforms\EarlyExpressionTransforms.cs" />

66
ICSharpCode.Decompiler/IL/ILAstWritingOptions.cs

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Text;
namespace ICSharpCode.Decompiler.IL
{
public class ILAstWritingOptions : INotifyPropertyChanged
{
private bool useLogicOperationSugar;
private bool useFieldSugar;
private bool showILRanges;
/// <summary>
/// Sugar for logic.not/and/or.
/// </summary>
public bool UseLogicOperationSugar {
get { return useLogicOperationSugar; }
set {
if (useLogicOperationSugar != value) {
useLogicOperationSugar = value;
OnPropertyChanged();
}
}
}
/// <summary>
/// Sugar for ldfld/stfld.
/// </summary>
public bool UseFieldSugar {
get { return useFieldSugar; }
set {
if (useFieldSugar != value) {
useFieldSugar = value;
OnPropertyChanged();
}
}
}
/// <summary>
/// Show IL ranges in ILAst output.
/// </summary>
public bool ShowILRanges {
get { return showILRanges; }
set {
if (showILRanges != value) {
showILRanges = value;
OnPropertyChanged();
}
}
}
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
}
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
{
PropertyChanged?.Invoke(this, e);
}
public event PropertyChangedEventHandler PropertyChanged;
}
}

13
ICSharpCode.Decompiler/IL/Instructions/ILInstruction.cs

@ -745,17 +745,4 @@ namespace ICSharpCode.Decompiler.IL
/// </summary> /// </summary>
StackType UnderlyingResultType { get; } StackType UnderlyingResultType { get; }
} }
public class ILAstWritingOptions
{
/// <summary>
/// Sugar for logic.not/and/or.
/// </summary>
public bool UseLogicOperationSugar { get; set; }
/// <summary>
/// Sugar for ldfld/stfld.
/// </summary>
public bool UseFieldSugar { get; set; }
}
} }

Loading…
Cancel
Save