Browse Source

Hide switch on string dictionary fields generated by mcs

pull/307/head
Jb Evain 14 years ago
parent
commit
14499e5d68
  1. 7
      ICSharpCode.Decompiler/Ast/AstBuilder.cs

7
ICSharpCode.Decompiler/Ast/AstBuilder.cs

@ -95,6 +95,8 @@ namespace ICSharpCode.Decompiler.Ast @@ -95,6 +95,8 @@ namespace ICSharpCode.Decompiler.Ast
if (settings.AnonymousMethods && IsAnonymousMethodCacheField(field))
return true;
if (settings.AutomaticProperties && IsAutomaticPropertyBackingField(field))
return true;
if (settings.SwitchStatementOnString && IsSwitchOnStringCache(field))
return true;
}
// event-fields are not [CompilerGenerated]
@ -105,6 +107,11 @@ namespace ICSharpCode.Decompiler.Ast @@ -105,6 +107,11 @@ namespace ICSharpCode.Decompiler.Ast
return false;
}
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);

Loading…
Cancel
Save