- //
- // We use this internally to flag that the method contains an iterator
- //
- public const int METHOD_YIELDS = 0x8000;
- public const int METHOD_GENERIC = 0x10000;
-
- public const int Accessibility =
- PUBLIC | PROTECTED | INTERNAL | PRIVATE;
- public const int AllowedExplicitImplFlags =
- UNSAFE | EXTERN;
-
- static public string Name (int i)
+ PARTIAL = 0x20000,
+ DEFAULT_ACCESS_MODIFER = 0x40000,
+ METHOD_EXTENSION = 0x80000,
+ COMPILER_GENERATED = 0x100000,
+ BACKING_FIELD = 0x200000,
+ DEBUGGER_HIDDEN = 0x400000,
+
+ AccessibilityMask = PUBLIC | PROTECTED | INTERNAL | PRIVATE,
+ AllowedExplicitImplFlags = UNSAFE | EXTERN,
+ }
+
+ static class ModifiersExtensions
+ {
+ public static string AccessibilityName (Modifiers mod)
+ {
+ switch (mod & Modifiers.AccessibilityMask) {
+ case Modifiers.PUBLIC:
+ return "public";
+ case Modifiers.PROTECTED:
+ return "protected";
+ case Modifiers.PROTECTED | Modifiers.INTERNAL:
+ return "protected internal";
+ case Modifiers.INTERNAL:
+ return "internal";
+ case Modifiers.PRIVATE:
+ return "private";
+ default:
+ throw new NotImplementedException (mod.ToString ());
+ }
+ }
+
+ static public string Name (Modifiers i)