CodeModel\ModifierFlagsExtensions.cs (38)
17private static readonly SortedList<ModifierFlags, SyntaxKind> s_modifierDefinitions = new()
19{ ModifierFlags.Public, SyntaxKind.PublicKeyword },
20{ ModifierFlags.Protected, SyntaxKind.ProtectedKeyword },
21{ ModifierFlags.Internal, SyntaxKind.InternalKeyword },
22{ ModifierFlags.Private, SyntaxKind.PrivateKeyword },
23{ ModifierFlags.Virtual, SyntaxKind.VirtualKeyword },
24{ ModifierFlags.Abstract, SyntaxKind.AbstractKeyword },
25{ ModifierFlags.New, SyntaxKind.NewKeyword },
26{ ModifierFlags.Override, SyntaxKind.OverrideKeyword },
27{ ModifierFlags.Sealed, SyntaxKind.SealedKeyword },
28{ ModifierFlags.Static, SyntaxKind.StaticKeyword },
29{ ModifierFlags.Extern, SyntaxKind.ExternKeyword },
30{ ModifierFlags.ReadOnly, SyntaxKind.ReadOnlyKeyword },
31{ ModifierFlags.Const, SyntaxKind.ConstKeyword },
32{ ModifierFlags.Volatile, SyntaxKind.VolatileKeyword },
33{ ModifierFlags.Unsafe, SyntaxKind.UnsafeKeyword },
34{ ModifierFlags.Async, SyntaxKind.AsyncKeyword },
35{ ModifierFlags.Partial, SyntaxKind.PartialKeyword }
38public static ModifierFlags GetModifierFlags(this MemberDeclarationSyntax member)
40ModifierFlags result = 0;
47result |= ModifierFlags.Public;
50result |= ModifierFlags.Protected;
53result |= ModifierFlags.Internal;
56result |= ModifierFlags.Private;
59result |= ModifierFlags.Virtual;
62result |= ModifierFlags.Abstract;
65result |= ModifierFlags.New;
68result |= ModifierFlags.Override;
71result |= ModifierFlags.Sealed;
74result |= ModifierFlags.Static;
77result |= ModifierFlags.Extern;
80result |= ModifierFlags.ReadOnly;
83result |= ModifierFlags.Const;
86result |= ModifierFlags.Volatile;
89result |= ModifierFlags.Unsafe;
92result |= ModifierFlags.Async;
95result |= ModifierFlags.Partial;
103public static MemberDeclarationSyntax UpdateModifiers(this MemberDeclarationSyntax member, ModifierFlags flags)