public NodeKeys(MegaApi.DataTypes.NodeKeys nk) { this.DecryptedKey = nk.DecryptedKey; this.EncryptedKey = nk.EncryptedKey; this.Keys = nk.Keys; }
public User(MegaApi.MegaUser mu) { this.Email = mu.Email; this.Id = mu.Id; this.NodeSid = mu.NodeSid; this.PassKey = mu.PassKey; this.PrivateKey = mu.PrivateKey; this.PublicKey = mu.PublicKey; this.Sid = mu.Sid; this.Status = mu.Status; }
public Node(MegaApi.MegaNode mn) : base() { this.Attributes = mn.Attributes; this.encryptedAttributes = mn.encryptedAttributes; this.Id = mn.Id; this.NodeKey = mn.NodeKey; this.ParentId = mn.ParentId; this.Size = mn.Size; this.Timestamp = mn.Timestamp; this.Type = mn.Type; this.UserId = mn.UserId; }
public NodeAttributes(MegaApi.DataTypes.NodeAttributes na) { this.Name = na.Name; }
public UserQuota(MegaApi.DataTypes.UserQuota uq) { this.Quota = uq.Max_Quota; this.Used = uq.Used_Quota; }
private void OnInitSuccess(MegaApi.Mega m) { client = m; ErrorNb = 0; }
void HandleServerRequest(object sender, MegaApi.Comms.ServerRequestArgs e) { if (refreshing) { return; } lock (serverNodes) { bool updates = false; bool needRefresh = false; foreach (var command in e.commands) { if (command.IsMine) { continue; } switch (command.Command) { case ServerCommandType.NodeAddition: var ca = (NodeAdditionCommand)command; var added = new List<MegaNodeHelper>(); foreach(var n in ca.Nodes) { if (IsInsideWorkingRoot(n)) { if (n.Type == MegaNodeType.Folder) { needRefresh = true; break; } else { added.Add(HelperFromNode(n)); updates = true; } } } serverNodes.AddRange(added); break; case ServerCommandType.NodeDeletion: var cd = (NodeDeletionCommand)command; var condemned = serverNodes.Where(n => n.Node.Id == cd.NodeId).FirstOrDefault(); if (condemned != null) { if (condemned.Node.Type == MegaNodeType.Folder) { needRefresh = true; } else { serverNodes.Remove(condemned); updates = true; } } break; case ServerCommandType.NodeUpdation: var cu = (NodeUpdationCommand)command; { var updating = serverNodes.Where(n => n.Node.Id == cu.NodeId).FirstOrDefault(); if (updating != null) { if (updating.Node.Type == MegaNodeType.Folder) { needRefresh = true; } else { updating.Node.Attributes = cu.Attributes; updates = true; } } } break; default: break; } if (needRefresh) { break; } } if (needRefresh) { RefreshNodeList(); } else if (updates) { OnUpdated(); } } }