Esempio n. 1
0
        public Parameters GenerateParameters(CodeFileTs input, Settings pluginSettings, IMetadataReader metadataReader, ILogger logger, IFileGroup <CodeFileTs, GroupItemDetails> fileGroup = null)
        {
            var searcher = new SearchVisitor();

            var classDeclarations = searcher.FindNodes <StClassDeclaration>(input.Model, c => true).ToArray();

            return(new Parameters()
            {
                AdditionalProperty = classDeclarations.Any(d => metadataReader.NodeIsGeneratedBy(input.NodePathService.GetNodePath(d), new ActivityFrame(pluginId: "TsTestPlugin"), out _))
            });
        }
Esempio n. 2
0
        public Parameters GenerateParameters(CodeFileCSharp input, Settings pluginSettings, IMetadataReader metadataReader, ILogger logger, IFileGroup <CodeFileCSharp, GroupItemDetails> fileGroup = null)
        {
            var cSharpFile = input as CodeFileCSharp;

            var propertyAdderActivity = new ActivityFrame(pluginId: AddPropertyPlugin.Plugin.PluginId);

            NodeRecord record;

            return(new Parameters()
            {
                PropertiesToDecorate = cSharpFile
                                       .SyntaxTree
                                       .GetRoot()
                                       .DescendantNodes()
                                       .OfType <PropertyDeclarationSyntax>()
                                       .Where(d => metadataReader.NodeIsGeneratedBy(cSharpFile.NodePathService.GetNodePath(d), propertyAdderActivity, out record))
            });
        }