示例#1
0
        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);
        }
示例#2
0
        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);
        }