Exemple #1
0
        public static EventDeclarationSyntax AddStaticModifier(EventDeclarationSyntax eventDeclaration)
        {
            if (eventDeclaration == null)
            {
                throw new ArgumentNullException(nameof(eventDeclaration));
            }

            SyntaxTokenList modifiers = eventDeclaration.Modifiers;

            if (!modifiers.Contains(SyntaxKind.StaticKeyword))
            {
                return(eventDeclaration.InsertModifier(SyntaxKind.StaticKeyword, ModifierComparer.Instance));
            }
            else
            {
                return(eventDeclaration);
            }
        }