private static string GetAccessorsString(PropertyDeclarationSyntax prop) { ChildSyntaxList children = prop.ChildNodesAndTokens(); var accessorList = children.FirstOrDefault(n => n.Kind == SyntaxKind.AccessorList); return(accessorList != null?accessorList.ToString() : string.Empty); }
BuildFileTarget AnalyzeProperty(PropertyDeclarationSyntax property) { var childs = property.ChildNodesAndTokens(); if (childs.Any(q => q.IsNode && q.ToString() == "Target") && property.ToString().Contains("Execute")) { return(new BuildFileTarget { TargetName = property.Identifier.ToString(), Code = property.ToString() }); } return(null); }