Skip to content
Browse files

Added some generated code member categories.

  • Loading branch information...
1 parent 0cbca24 commit 1576e0845a757fc30d2943c87aed6433aa3d57aa @mkrueger mkrueger committed Apr 10, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 ICSharpCode.NRefactory.CSharp/Formatter/GeneratedCodeSettings.cs
View
12 ICSharpCode.NRefactory.CSharp/Formatter/GeneratedCodeSettings.cs
@@ -37,11 +37,13 @@ public enum GeneratedCodeMember
InstanceFields,
StaticProperties,
InstanceProperties,
+ Indexer,
Constructors,
StaticMethods,
InstanceMethods,
StaticEvents,
InstanceEvents,
+ Operators,
NestedTypes
}
@@ -86,6 +88,8 @@ public virtual string GetCategoryLabel(GeneratedCodeMember memberCategory)
return "Static Properties";
case GeneratedCodeMember.InstanceProperties:
return "Properties";
+ case GeneratedCodeMember.Indexer:
+ return "Indexer";
case GeneratedCodeMember.Constructors:
return "Constructors";
case GeneratedCodeMember.StaticMethods:
@@ -96,6 +100,8 @@ public virtual string GetCategoryLabel(GeneratedCodeMember memberCategory)
return "Static Events";
case GeneratedCodeMember.InstanceEvents:
return "Events";
+ case GeneratedCodeMember.Operators:
+ return "Operators";
case GeneratedCodeMember.NestedTypes:
return "Nested Types";
}
@@ -118,12 +124,16 @@ GeneratedCodeMember GetCodeMemberCategory(EntityDeclaration x)
bool isStatic = x.HasModifier(Modifiers.Static) || x.HasModifier(Modifiers.Const);
if (x is FieldDeclaration)
return isStatic ? GeneratedCodeMember.StaticFields : GeneratedCodeMember.InstanceFields;
+ if (x is IndexerDeclaration)
+ return GeneratedCodeMember.Indexer;
if (x is PropertyDeclaration)
return isStatic ? GeneratedCodeMember.StaticProperties : GeneratedCodeMember.InstanceProperties;
if (x is ConstructorDeclaration || x is DestructorDeclaration)
return GeneratedCodeMember.Constructors;
if (x is MethodDeclaration)
return isStatic ? GeneratedCodeMember.StaticMethods : GeneratedCodeMember.InstanceMethods;
+ if (x is OperatorDeclaration)
+ return GeneratedCodeMember.Operators;
if (x is EventDeclaration)
return isStatic ? GeneratedCodeMember.StaticEvents : GeneratedCodeMember.InstanceEvents;
@@ -179,11 +189,13 @@ public override void VisitTypeDeclaration(TypeDeclaration typeDeclaration)
GeneratedCodeMember.InstanceFields,
GeneratedCodeMember.StaticProperties,
GeneratedCodeMember.InstanceProperties,
+ GeneratedCodeMember.Indexer,
GeneratedCodeMember.Constructors,
GeneratedCodeMember.StaticMethods,
GeneratedCodeMember.InstanceMethods,
GeneratedCodeMember.StaticEvents,
GeneratedCodeMember.InstanceEvents,
+ GeneratedCodeMember.Operators,
GeneratedCodeMember.NestedTypes
},
GenerateCategoryComments = true,

0 comments on commit 1576e08

Please sign in to comment.
Something went wrong with that request. Please try again.