/// <summary> /// /// </summary> private void UpdateStats() { BuildManifestFileDiff Diff = SourceManifestDeltaTree.SelectedDiff; if (Diff == null) { pathLabel.Text = "..."; blockLabel.Text = "..."; checksumLabel.Text = "..."; } else { pathLabel.Text = Diff.FileInfo.Path; blockLabel.Text = (Diff.FileInfo.LastBlockIndex - Diff.FileInfo.FirstBlockIndex).ToString(); checksumLabel.Text = Diff.FileInfo.Checksum; } }
/// <summary> /// /// </summary> /// <param name="Path"></param> /// <param name="Metadata"></param> /// <returns></returns> private Node GetOrCreateNode(string Path, BuildManifestFileDiff Metadata, bool DoNotCreate = false) { if (Path == "") { return(Model.Root); } if (NodeCache.ContainsKey(Path)) { return(NodeCache[Path]); } string ChildNode = VirtualFileSystem.GetNodeName(Path); Node Parent = GetOrCreateNode(VirtualFileSystem.GetParentPath(Path), null); /*foreach (Node node in Parent.Nodes) * { * if (node.Text == ChildNode) * { * return node; * } * }*/ if (DoNotCreate) { return(null); } DeltaTreeNode NewNode = new DeltaTreeNode(); NewNode.Name = ChildNode; NewNode.Diff = Metadata; NewNode.Text = ChildNode; NewNode.FullPath = Path; Parent.Nodes.Add(NewNode); NodeCache.Add(Path, NewNode); UpdateNode(NewNode); return(NewNode); }