private string GenerateDisplayName(Node node, IEnumerable<Node> nodes) { List<string> nodesTree = new List<string>(); Node parent = node; do { if (parent.Type == NodeType.Directory) { nodesTree.Add(parent.Name); } else { nodesTree.Add(parent.Type.ToString()); } parent = nodes.FirstOrDefault(n => n.Id == parent.ParentId); } while (parent != null); nodesTree.Reverse(); return string.Join(@"\", nodesTree.ToArray()); }
public MoveRequest(Node node, Node destinationParentNode) : base("m") { this.Id = node.Id; this.DestinationParentId = destinationParentNode.Id; }
public DisplayNode(Node node, IEnumerable<Node> nodes) { Node = node; DisplayName = GenerateDisplayName(node, nodes); }
public static CreateNodeRequest CreateFolderNodeRequest(Node parentNode, string attributes, string encryptedkey) { return new CreateNodeRequest(parentNode, NodeType.Directory, attributes, encryptedkey, "xxxxxxxx"); }
public DownloadUrlRequest(Node node) : base("g") { this.Id = node.Id; }
public static CreateNodeRequest CreateFileNodeRequest(Node parentNode, string attributes, string encryptedkey, string completionHandle) { return new CreateNodeRequest(parentNode, NodeType.File, attributes, encryptedkey, completionHandle); }
private CreateNodeRequest(Node parentNode, NodeType type, string attributes, string encryptedKey, string completionHandle) : base("p") { this.ParentId = parentNode.Id; this.Nodes = new[] { new CreateNodeRequestData { Attributes = attributes, Key = encryptedKey, Type = type, CompletionHandle = completionHandle } }; }
public GetDownloadLinkRequest(Node node) : base("l") { this.Id = node.Id; }
public DeleteRequest(Node node) : base("d") { this.Node = node.Id; }
public bool Equals(Node other) { return other != null && this.Id == other.Id; }