CSharp examples for Microsoft.CodeAnalysis:Roslyn
Checks for Static modification in method syntax using Roslyn.
using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis; public class Main{ /// <summary> /// Checks for Static modification in method syntax. /// </summary> /// <param name="methodSyntax"></param> /// <returns></returns> public static bool IsStatic(this MethodDeclarationSyntax methodSyntax) {// www . j a va 2 s . c o m return methodSyntax.Modifiers.Any(SyntaxKind.StaticKeyword); } }