public MRequestUpdateAttributes(MegaUser user, MegaNode node) : base(user) { MegaNode.EncryptAttrs(node); encryptedAttributes = node.encryptedAttributes; n = node.Id; key = node.NodeKey.EncryptedKey; }
public void query_with_or_on_child_document() { StoreOptions(_ => { _.Schema.For <User>().AddSubClass <MegaUser>(); }); var megaUser1 = new MegaUser() { DisplayName = "Yann", RealName = "Yann Yann" }; var megaUser2 = new MegaUser() { DisplayName = "Robin", RealName = "Robin Robin" }; var megaUser3 = new MegaUser() { DisplayName = "Marten", RealName = "Marten Marten" }; theStore.BulkInsert(new User[] { megaUser1, megaUser2, megaUser3 }); using (var session = theStore.QuerySession()) { session.Query <MegaUser>() .Where(_ => _.DisplayName == "Yann" || _.DisplayName == "Robin").OrderBy(x => x.DisplayName).Select(x => x.DisplayName) .ToList() .ShouldHaveTheSameElementsAs("Robin", "Yann"); } }
public Form1() { InitializeComponent(); System.Net.ServicePointManager.DefaultConnectionLimit = 50; notifyIcon1.Icon = Properties.Resources.min; notifyIcon1.Click += notifyIcon1_MouseClick; if (!string.IsNullOrEmpty(Properties.Settings.Default.folderPath)) { textBoxFolder.Text = Properties.Settings.Default.folderPath; } else { textBoxFolder.Text = Path.Combine( Environment.GetEnvironmentVariable("USERPROFILE"), "MegaDesktop"); } auth = Mega.LoadAccount(GetUserKeyFilePath()); if (auth != null) { textBoxEmail.Text = auth.Email; textBoxPassword.Text = "password"; } }
public NodeKeys(byte[] key, MegaUser user) { DecryptedKey = key; EncryptedKey = Crypto.Encrypt(user.masterKeyAlg, key); Keys = new Dictionary <string, byte[]> { { user.Id, EncryptedKey } }; }
public MRequestCompleteUpload(MegaUser user, MegaNode node) : base(user) { t = node.ParentId; n = new List <MegaNode> { node }; this.user = user; Converters.Add(new NodeKeyConverter(user.masterKeyAlg, user)); }
public MRequestGetSid(MegaUser user) : base(user) { Sid = null; this.user = user.Id; passKey = user.PassKey; if (user.Email != null) { this.user = user.Email.ToLower(); uh = user.GetHash(); } }
public MRequestCreateAnon(MegaUser user) : base(user) { var ssc = Crypto.RandomKey(16); var aes = Crypto.CreateAes(user.PassKey); var e_ssc = Crypto.Encrypt(aes, ssc); ts = new byte[ssc.Length + e_ssc.Length]; Array.Copy(ssc, ts, ssc.Length); Array.Copy(e_ssc, 0, ts, ssc.Length, e_ssc.Length); k = user.EncryptUserKey(); }
public MRequestCreateFolder(MegaUser user, string folderName, string parentNode) : base(user) { this.user = user; t = parentNode; var folder = new MegaNode { Id = "xxxxxxxx", Type = MegaNodeType.Folder, Attributes = new NodeAttributes { Name = folderName }, NodeKey = new NodeKeys(Crypto.RandomKey(16), user) }; n.Add(folder); Converters.Add(new NodeKeyConverter(user.masterKeyAlg, user)); }
// p - ? public MRequestGetDownloadUrl(MegaUser user, string nodeId) : base(user) { n = nodeId; }
public MRequestRemoveNode(MegaUser user, string nodeId) : base(user) { n = nodeId; }
public PollingTransport(MegaUser user) { this.user = user; }
private void buttonStart_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBoxEmail.Text) || string.IsNullOrEmpty(textBoxPassword.Text) || string.IsNullOrEmpty(textBoxFolder.Text) ) { return; } buttonBrowse.Enabled = false; textBoxFolder.Enabled = false; buttonStart.Enabled = false; buttonExit.Enabled = false; if (!Directory.Exists(textBoxFolder.Text)) { Directory.CreateDirectory(textBoxFolder.Text); Properties.Settings.Default.FolderBeautified = false; } var needResync = false; if (Properties.Settings.Default.folderPath != textBoxFolder.Text) { needResync = true; Properties.Settings.Default.FolderBeautified = false; } Properties.Settings.Default.folderPath = textBoxFolder.Text; Properties.Settings.Default.Save(); CheckFolderBeautified(); textBoxLoginStatus.Text = "Connecting..."; textBoxEmail.Enabled = false; textBoxPassword.Enabled = false; if ((auth != null && textBoxEmail.Text != auth.Email) || textBoxPassword.Text != "password" || auth == null) { auth = new MegaUser(textBoxEmail.Text, textBoxPassword.Text); } Mega.Init(auth, (m) => { Invoke(new Action(() => { textBoxLoginStatus.Text = "Working."; })); StartSync(m, needResync); }, (i) => { Invoke(new Action(() => { textBoxLoginStatus.Text = "Invalid login or password"; textBoxEmail.Enabled = true; textBoxPassword.Enabled = true; buttonStart.Enabled = true; buttonExit.Enabled = true; textBoxFolder.Enabled = true; buttonStart.Enabled = true; })); }); }
public TrackingRequest(MegaUser user) : base(user) { IsTracking = true; TrackingId = Util.RandomString(10); }
public ServerCommandConverter(MegaUser user) { this.user = user; }
public MRequestMoveNode(MegaUser user, string nodeId, string targetNodeId) : base(user) { n = nodeId; t = targetNodeId; }
public MRequestGetFiles(MegaUser user) : base(user) { this.user = user; }
public NodeKeyConverter(SymmetricAlgorithm alg, MegaUser user) : base(alg) { userId = user.Id; }
public MRequestGetUser(MegaUser user) : base(user) { }
//r : ul_queue[i].retries //e : ul_lastreason //ms : ul_maxSpeed public MRequestGetUploadUrl(MegaUser user, long filesize) : base(user) { s = filesize; }
public NodeKeys(byte[] key, MegaUser user) { DecryptedKey = key; EncryptedKey = Crypto.Encrypt(user.masterKeyAlg, key); Keys = new Dictionary<string,byte[]> { {user.Id, EncryptedKey} }; }