示例#1
0
        private void OnReloadClicked(object sender, EventArgs e)
        {
            var spinner         = UIUtils.ShowSpinner(this);
            var instagramHelper = new InstagramHelper(_mua.Instagram, this);

            instagramHelper.OnImagesLoad += (s, instagramStr) =>
            {
                if (!string.IsNullOrEmpty(instagramStr))
                {
                    DataGate.MuaUpdatePictures(_mua.Id, instagramStr.Split(','), r =>
                    {
                        if (r.Code == ResponseCode.OK && r.Result == "true")
                        {
                            Device.BeginInvokeOnMainThread(() =>
                            {
                                _mua.Images = instagramStr.Split(',').ToList();
                                FillGrid();
                            });
                        }
                        else
                        {
                            UIUtils.ShowServerUnavailable(this);
                        }
                        UIUtils.HideSpinner(this, spinner);
                    });
                }
                else
                {
                    UIUtils.HideSpinner(this, spinner);
                }
            };
            instagramHelper.Start();
        }
示例#2
0
        private void OnContinue(object sender, EventArgs e)
        {
            if (currentStep == 1)
            {
                bool valid = UIUtils.ValidateEntriesWithEmpty(new Entry[] { phoneEntry.NumberEntry, addressEntry, emailEntry, pswdEntry, pswdConfirmEntry, lnameEntry, fnameEntry }, this);
                if (valid)
                {
                    if (pswdEntry.Text != pswdConfirmEntry.Text)
                    {
                        UIUtils.ShowMessage("Confirm password is not valid", this);
                        return;
                    }
                    BuildStep2();
                    DataGate.VerifyPhoneNumber(phoneEntry.PhoneNumber, (res) =>
                    {
                        if (res.Code == ResponseCode.OK)
                        {
                            currentCode = res.Result.Trim('"');
#if DEBUG
                            Device.BeginInvokeOnMainThread(() =>
                            {
                                codeEntry.Text = currentCode;
                            });
#endif
                        }
                    });
                }
            }
            else if (currentStep == 2)
            {
                if (currentCode == codeEntry.Text)
                {
                    BuildStep3();
                }
                else
                {
                    UIUtils.ShowMessage("Confirmation code is not valid", this);
                }
            }
            else if (currentStep == 3)
            {
                BuildStep4();
            }
            else
            {
                if (string.IsNullOrEmpty(instagramEntry.Text))
                {
                    UIUtils.ShowMessage("Please enter instagram account", this);
                    return;
                }
                spinner = UIUtils.ShowSpinner(this);
                var instagramHelper = new InstagramHelper(instagramEntry.Text, this);
                instagramHelper.OnImagesLoad += OnInstagramImagesLoad;
                instagramHelper.Start();
            }
        }