Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
        }
Пример #4
0
        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);
        }