|
|
|
@ -76,7 +76,7 @@ namespace ICSharpCode.Decompiler.Ast
@@ -76,7 +76,7 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
|
|
|
|
|
TypeDefinition type = member as TypeDefinition; |
|
|
|
|
if (type != null) { |
|
|
|
|
if (type.DeclaringType != null) { |
|
|
|
|
if (type.DeclaringType != null) { |
|
|
|
|
if (settings.AnonymousMethods && IsClosureType(type)) |
|
|
|
|
return true; |
|
|
|
|
if (settings.YieldReturn && YieldReturnDecompiler.IsCompilerGeneratorEnumerator(type)) |
|
|
|
@ -91,12 +91,12 @@ namespace ICSharpCode.Decompiler.Ast
@@ -91,12 +91,12 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
|
|
|
|
|
FieldDefinition field = member as FieldDefinition; |
|
|
|
|
if (field != null) { |
|
|
|
|
if (field.IsCompilerGenerated()) { |
|
|
|
|
if (field.IsCompilerGenerated()) { |
|
|
|
|
if (settings.AnonymousMethods && IsAnonymousMethodCacheField(field)) |
|
|
|
|
return true; |
|
|
|
|
return true; |
|
|
|
|
if (settings.AutomaticProperties && IsAutomaticPropertyBackingField(field)) |
|
|
|
|
return true; |
|
|
|
|
if (settings.SwitchStatementOnString && IsSwitchOnStringCache(field)) |
|
|
|
|
return true; |
|
|
|
|
if (settings.SwitchStatementOnString && IsSwitchOnStringCache(field)) |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
// event-fields are not [CompilerGenerated]
|
|
|
|
@ -107,24 +107,24 @@ namespace ICSharpCode.Decompiler.Ast
@@ -107,24 +107,24 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static bool IsSwitchOnStringCache(FieldDefinition field) |
|
|
|
|
{ |
|
|
|
|
return field.Name.StartsWith("<>f__switch", StringComparison.Ordinal); |
|
|
|
|
static bool IsSwitchOnStringCache(FieldDefinition field) |
|
|
|
|
{ |
|
|
|
|
return field.Name.StartsWith("<>f__switch", StringComparison.Ordinal); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static bool IsAutomaticPropertyBackingField(FieldDefinition field) |
|
|
|
|
{ |
|
|
|
|
return field.HasGeneratedName() && field.Name.EndsWith("BackingField", StringComparison.Ordinal); |
|
|
|
|
static bool IsAutomaticPropertyBackingField(FieldDefinition field) |
|
|
|
|
{ |
|
|
|
|
return field.HasGeneratedName() && field.Name.EndsWith("BackingField", StringComparison.Ordinal); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static bool IsAnonymousMethodCacheField(FieldDefinition field) |
|
|
|
|
{ |
|
|
|
|
return field.Name.StartsWith("CS$<>", StringComparison.Ordinal) || field.Name.StartsWith("<>f__am", StringComparison.Ordinal); |
|
|
|
|
static bool IsAnonymousMethodCacheField(FieldDefinition field) |
|
|
|
|
{ |
|
|
|
|
return field.Name.StartsWith("CS$<>", StringComparison.Ordinal) || field.Name.StartsWith("<>f__am", StringComparison.Ordinal); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static bool IsClosureType(TypeDefinition type) |
|
|
|
|
{ |
|
|
|
|
return type.HasGeneratedName() && type.IsCompilerGenerated() && (type.Name.Contains("DisplayClass") || type.Name.Contains("AnonStorey")); |
|
|
|
|
static bool IsClosureType(TypeDefinition type) |
|
|
|
|
{ |
|
|
|
|
return type.HasGeneratedName() && type.IsCompilerGenerated() && (type.Name.Contains("DisplayClass") || type.Name.Contains("AnonStorey")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|