コード例 #1
0
 private InternalHandle GetNodeHandle(IReadableDargonNode node)
 {
     return(handlesByNode.AddOrUpdate(node, n => new InternalHandle(n), (n, h) => {
         h.IncrementReferenceCount();
         return h;
     }));
 }
コード例 #2
0
 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);
             }
        }
コード例 #4
0
 public void EndReset(IReadableDargonNode node)
 {
     this.node  = node;
     this.state = node == null ? HandleState.Invalidated : HandleState.Valid;
 }
コード例 #5
0
 public void BeginReset()
 {
     node  = null;
     state = HandleState.Reset;
 }
コード例 #6
0
 public InternalHandle(IReadableDargonNode node)
 {
     this.node           = node;
     this.state          = HandleState.Valid;
     this.referenceCount = 0;
 }
コード例 #7
0
 public NodeViewModel CreateFromNode(IReadableDargonNode node)
 {
     var children = node.Children.Select(CreateFromNode).ToArray();
      return new NodeViewModel(nodeOperationsController, node, children);
 }
コード例 #8
0
 public NodeViewModel(NodeOperationsController nodeOperationsController, IReadableDargonNode node, IReadOnlyList<NodeViewModel> children)
 {
     this.nodeOperationsController = nodeOperationsController;
      this.node = node;
      this.children = children;
 }