示例#1
0
 public SourcingFrom(ISingleNodeSnapshot from, ISubTreeSnapshot subject, int batchindex, string stageName, string pluginId, object pluginMetadata, IDictionary <string, string> tags)
     : base(batchindex, stageName, pluginId, pluginMetadata, tags)
 {
     this.Scopes.Add(from);
     this.Scopes.Add(subject);
     this.From    = from;
     this.Subject = subject;
 }
 public SyntaxEditor(ISubTreeSnapshot snapshot, CodeFileCSharp input, CodeFileCSharp output, Parameters inputParameters, Settings settings)
 {
     this.snapshot        = snapshot;
     this.input           = input;
     this.output          = output;
     this.inputParameters = inputParameters;
     this.settings        = settings;
 }
示例#3
0
        public Generated(ISubTreeSnapshot subject, int batchindex, string stageName, string pluginId, object pluginMetadata, IDictionary <string, string> tags, ISingleNodeSnapshot from = null)
            : base(batchindex, stageName, pluginId, pluginMetadata, tags)
        {
            this.Scopes.Add(subject);
            if (from != null)
            {
                this.Scopes.Add(from);
            }

            this.Subject = subject;
            this.From    = from;
        }
示例#4
0
        protected void Refine(Node source, NodePathLevel[] sourceRootLevels, NodePathLevel[] subjectRootLevels, ISubTreeSnapshot subjectSnapshot, List <NodeRelation> result)
        {
            if (source.Records.Count > 0)
            {
                var      sourceLevels = source.GetPathLevelsFromRoot().ToArray();
                NodePath path         = new NodePath(source.Language, subjectRootLevels.Concat(NodePath.RelativeTo(sourceLevels, sourceRootLevels)));
                if (subjectSnapshot.ContainsNode(path))
                {
                    result.Add(new NodeRelation(RelationKind.SourcingFrom, this.metadataIndexed.AllocateNode(path), source));
                }
                else
                {
                    return;
                }
            }

            foreach (var c in source.Children)
            {
                this.Refine(c.Value, sourceRootLevels, subjectRootLevels, subjectSnapshot, result);
            }
        }
示例#5
0
        protected IEnumerable <NodeRelation> RefineSourcingFromRelations(Node source, Node subject, ISubTreeSnapshot subjectSnapshot)
        {
            List <NodeRelation> result = new List <NodeRelation>();

            foreach (var c in source.Children)
            {
                this.Refine(c.Value, source.GetPathLevelsFromRoot().ToArray(), subject.GetPathLevelsFromRoot().ToArray(), subjectSnapshot, result);
            }

            return(result);
        }