private InternalHandle GetNodeHandle(IReadableDargonNode node) { return(handlesByNode.AddOrUpdate(node, n => new InternalHandle(n), (n, h) => { h.IncrementReferenceCount(); return h; })); }
private void DumpTree(IReadableDargonNode tree) { Console.WriteLine(tree.GetPath()); foreach (var node in tree.Children) { DumpTree(node); } }
public void DumpNode(IReadableDargonNode node) { var leaves = node.EnumerateLeaves().Cast<ReleaseManifestFileEntry>(); foreach (var leaf in leaves) { var archives = archiveCache.GetArchive(leaf.ArchiveId); var entry = archives.Select(archive => new { archive, entry = archive.GetDirectoryFile().GetFileList().GetFileEntryOrNull(leaf.GetPath()) }) .First(pair => pair.entry != null).entry; var content = entry.GetContent(); var outputPath = @"C:/dargonDump" + leaf.GetPath(); fileSystemProxy.PrepareParentDirectory(outputPath); File.WriteAllBytes(outputPath, content); } }
public void EndReset(IReadableDargonNode node) { this.node = node; this.state = node == null ? HandleState.Invalidated : HandleState.Valid; }
public void BeginReset() { node = null; state = HandleState.Reset; }
public InternalHandle(IReadableDargonNode node) { this.node = node; this.state = HandleState.Valid; this.referenceCount = 0; }
public NodeViewModel CreateFromNode(IReadableDargonNode node) { var children = node.Children.Select(CreateFromNode).ToArray(); return new NodeViewModel(nodeOperationsController, node, children); }
public NodeViewModel(NodeOperationsController nodeOperationsController, IReadableDargonNode node, IReadOnlyList<NodeViewModel> children) { this.nodeOperationsController = nodeOperationsController; this.node = node; this.children = children; }