public UsesTreeNode(DelphiFile file, UsesSection section) { if (file == null) throw new ArgumentNullException("file"); this.file = file; this.section = section; this.LazyLoading = true; }
public void Resolve(DelphiAnalysis container) { TargetFile = container.ResolveUnitName(ParentFile.FileName, Name); // TODO : split 'Resolve' and add to list and parallelise if (TargetFile != null) { TargetFile.UsedByFiles.Add(ParentFile); ParentFile.UsesFiles.Add(TargetFile); } }
public DelphiFileTreeNode(DelphiFile file) { if (file == null) throw new ArgumentNullException("file"); this.file = file; Children.Add(new UsesTreeNode(file, UsesSection.Both)); Children.Add(new UsedByTreeNode(file, UsesSection.Both)); }
public UsesClause(DelphiFile file, string name, string @namespace = null, string inLocation = null) { if (file == null) throw new ArgumentNullException("file"); this.ParentFile = file; this.Name = name; this.Namespace = @namespace; this.InLocation = inLocation; }
public static MenuItem CreateAnalyzeThis(DelphiFile file) { if (file == null) throw new ArgumentNullException("file"); var item = new MenuItem { Header = "Analyze this!" }; item.Click += (sender, e) => Window1.AnalyzeThis(file); return item; }
public void AddResult(DelphiFile endPoint, DelphiFile result, Dictionary<DelphiFile, DelphiFile> parent) { var comparer = KeyComparer.Create<SharpTreeNode, Package>(n => { var pNode = n as PackageTreeNode; if (pNode != null) return pNode.Package; return null; }, Window1.CurrentAnalysis.PackageOrderComparer); foreach (var package in endPoint.DirectlyInPackages) { var p = package; var packageNode = Children.OfType<PackageTreeNode>().FirstOrDefault(n => n.Package == p); if (packageNode == null) { packageNode = new PackageTreeNode(p, result); Children.OrderedInsert(packageNode, comparer, 2); } packageNode.AddResult(endPoint, parent); } }
public ResultTreeNode(DelphiFile result) : base(result) { }
void UpdateChildren(DelphiFile[] path) { var nextNode = path.ElementAtOrDefault(current + 1); if (nextNode == null) return; var pathTreeNode = Children.OfType<PathTreeNode>().FirstOrDefault(n => n.node == nextNode); if (pathTreeNode == null) { pathTreeNode = new PathTreeNode(path, current + 1); Children.OrderedInsert(pathTreeNode, NodeTextComparer); } else { pathTreeNode.AddPath(path); } }
public void AddPath(DelphiFile[] path) { this.paths.Add(path); if (!IsVisible) { Children.Clear(); LazyLoading = true; return; } UpdateChildren(path); RaisePropertyChanged("Text"); }
public PathTreeNode(DelphiFile[] path, int current) { if (path == null) throw new ArgumentNullException("path"); if (path.Length <= current) throw new ArgumentException(); Debug.Assert(current > 0); this.paths.Add(path); this.current = current; this.node = path[current]; this.LazyLoading = current < path.Length - 1; }
public void AddResult(DelphiFile endPoint, Dictionary<DelphiFile, DelphiFile> parents) { Debug.Assert(target != null); results.Add(Tuple.Create(endPoint, parents)); }
public PackageTreeNode(Package package, DelphiFile target = null) { if (package == null) throw new ArgumentNullException("package"); this.package = package; this.target = target; LazyLoading = true; }
public static MenuItem CreateCopyUnitName(DelphiFile file) { if (file == null) throw new ArgumentNullException("file"); var item = new MenuItem { Header = "Copy unit name" }; item.Click += (sender, e) => Clipboard.SetText(file.UnitName); return item; }