async void Box_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key != System.Windows.Input.Key.Enter || box.Text == "") { return; } waiting(); await client.question(new q_upsertmessage() { partner = partnerid, text = box.Text }); box.Text = null; release(); }
async Task save() { loadbox.mainwaiting(); if (!await valid()) { return; } var rsv = await client.question(new q_upsertuser() { user = user }) as q_upsertuser.done; if (rsv.error_duplicate) { await messagebox.maindilog((null, "این نام قبلا به ثبت رسیده است. لطفا آن را تغییر دهید")); } loadbox.mainrelease(); }
async Task save() { loadbox.mainwaiting(); if (!await valid()) { return; } var rsv = await client.question(new q_upsertuser() { user = user }) as q_upsertuser.done; if (rsv.error_duplicate) { await messagebox.maindilog((null, "This name has already been registered. Please change it")); } loadbox.mainrelease(); }
protected virtual async void sync() { long index = dbindex.get(indexid); var rsv = await client.question(userid, new q_loaddiff(server) { index = index }) as q_loaddiff.done; if (rsv.entites != null) { var dv = JsonConvert.DeserializeObject <entity[]>(rsv.entites); foreach (var i in dv) { apply(i); } } foreach (var i in rsv.deleted) { delete(i); } dbindex.set(indexid, rsv.currentindex); }