public void OnClick(IDialogInterface dialog, int which)
        {
            switch ((DialogButtonType)which)
            {
            case DialogButtonType.Positive:
                Dictionary <string, string> update = new Dictionary <string, string>
                {
                    { "operation", "patch" },
                    { "text", editView.Text },
                    { "key", editView.Tag.ToString() }
                };

                controller.DataUpdated(update);
                ((TextView)options.FindViewWithTag(editView.Tag)).Text = editView.Text;
                dialog.Dismiss();
                break;

            case DialogButtonType.Neutral:
                Dictionary <string, string> del = new Dictionary <string, string>
                {
                    { "operation", "del" },
                    { "key", editView.Tag.ToString() }
                };
                controller.DataUpdated(del);
                options.RemoveView(options.FindViewWithTag(editView.Tag));
                dialog.Dismiss();
                break;

            default:
                dialog.Dismiss();
                break;
            }
        }
Beispiel #2
0
        public void OnClick(View v)
        {
            string value = textInput?.Text;

            if (!string.IsNullOrEmpty(value))
            {
                value = value.Trim();
            }

            if (validator != null)
            {
                if (validator(value))
                {
                    Tcs.TrySetResult(value);
                    dialog.Dismiss();
                    return;
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("Not Valid");
                    return;
                }
            }
            else
            {
                Tcs.TrySetResult(value);
                dialog.Dismiss();

                return;
            }
        }
 void ReportSuccess()
 {
     System.Diagnostics.Debug.WriteLine("Auth Success");
     if (_tcsWeak.TryGetTarget(out var tcs))
     {
         tcs.TrySetResult(new AuthenticationResult(true));
     }
     _dialog.Dismiss();
 }
 public void OnClick(IDialogInterface dialog, int which)
 {
     switch(which)
     {
         case IDialogInterfaceConstants.BUTTON_POSITIVE:
             doInBackground();
             dialog.Dismiss();
             break;
         default:
             dialog.Dismiss();
             break;
     }
 }
Beispiel #5
0
        public void OnClick(IDialogInterface dialog, int which)
        {
            switch (which)
            {
            case IDialogInterfaceConstants.BUTTON_POSITIVE:
                doInBackground();
                dialog.Dismiss();
                break;

            default:
                dialog.Dismiss();
                break;
            }
        }
Beispiel #6
0
        public void OnClick(IDialogInterface dialog, int which)
        {
            var resGoalTime = GoalTimeDao.GetGoalTime();

            if (resGoalTime == null)
            {
                return;
            }
            switch (resGoalTime.Name)
            {
            case "Year":
                foreach (var item in Singleton.Instance.GoalCheckBoxs)
                {
                    CheckBox chk = item.CheckBox;
                    if (chk.Checked)
                    {
                        GoalDao.Delete(item.IDGoal);
                    }
                }
                //GoalUtils.GetGoal();
                dialog.Dismiss();
                break;

            case "Month":
                foreach (var item in Singleton.Instance.GoalCheckBoxs)
                {
                    CheckBox chk = item.CheckBox;
                    if (chk.Checked)
                    {
                        GoalOfMonthDao.Delete(item.IDGoal);
                    }
                }
                //GoalUtils.GetGoal();
                dialog.Dismiss();
                break;

            case "Day":
                foreach (var item in Singleton.Instance.GoalCheckBoxs)
                {
                    CheckBox chk = item.CheckBox;
                    if (chk.Checked)
                    {
                        GoalOfDayDao.Delete(item.IDGoal);
                    }
                }
                //GoalUtils.GetGoal();
                dialog.Dismiss();
                break;
            }
        }
Beispiel #7
0
        void StartPrivateChat(object sender, EventArgs e)
        {
            var buider = new AlertDialog.Builder(this);

            buider.SetTitle("选择联系人");
            var list  = users.FindAll((obj) => { return(!obj.Equals(currentUser)); });
            var names = list.ConvertAll((input) => { return(input.name); });

            buider.SetItems(names.ToArray(), (object s, DialogClickEventArgs args) =>
            {
                IDialogInterface dialog = s as IDialogInterface;
                if (dialog != null)
                {
                    dialog.Dismiss();
                    var friend = users.Find((obj) => { return(obj.name.Equals(names[args.Which])); });
                    if (RongCallClient.Instance != null)
                    {
                        RongCallKit.StartSingleCall(this, friend.id, RongCallKit.CallMediaType.CallMediaTypeVideo);
                    }
                    else
                    {
                        ShowMsg("未连接");
                    }
                }
            });
            buider.Show();
        }
Beispiel #8
0
            public void OnCancel(IDialogInterface dialog)
            {
                if (typeof(T) == typeof(bool))
                {
                    (Handler as TaskCompletionSource <bool>).TrySetResult(false);
                }
                else if (typeof(T) == typeof(int))
                {
                    (Handler as TaskCompletionSource <int>).TrySetResult(-1);
                }
                else if (typeof(string) == typeof(string))
                {
                    (Handler as TaskCompletionSource <string>).TrySetResult(null);
                }
                else if (typeof(object) == typeof(object))
                {
                    (Handler as TaskCompletionSource <object>).TrySetResult(null);
                }
                else
                {
                    Handler.TrySetResult(default(T));
                }

                dialog?.Dismiss();
            }
Beispiel #9
0
        void DoLogin(object sender, EventArgs e)
        {
            var uername  = m_username.Text;
            var password = m_password.Text;
            //do some check ...

            var buider = new Android.Support.V7.App.AlertDialog.Builder(this);

            buider.SetTitle("选择联系人");
            var names = DataProvider.AllUsers.ConvertAll((input) => { return(input.Name); });

            buider.SetItems(names.ToArray(), (object s, DialogClickEventArgs args) =>
            {
                IDialogInterface dialog = s as IDialogInterface;
                if (dialog != null)
                {
                    dialog.Dismiss();
                    FindViewById(Resource.Id.wait_view).Visibility  = Android.Views.ViewStates.Visible;
                    FindViewById(Resource.Id.login_form).Visibility = Android.Views.ViewStates.Gone;
                    UserInfo userInfo = DataProvider.RequestLogin(args.Which);
                    string token      = DataProvider.GetTokenByUser(userInfo);
                    AppConfig.Instance.UserLogin(userInfo, token);
                    RongIM.Connect(token, new ConnectCallback(this));
                }
            });
            buider.Show();
        }
Beispiel #10
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     SharedPrefsAutofillRepository.GetInstance().Clear(that);
     SharedPrefsPackageVerificationRepository.GetInstance().Clear(that);
     MyPreferences.GetInstance(that).ClearCredentials();
     dialog.Dismiss();
 }
Beispiel #11
0
            public void OnClick(IDialogInterface dialog, int which)
            {
                string password = newPasswordField.Text;

                preferences.SetMasterPassword(password);
                dialog.Dismiss();
            }
Beispiel #12
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     if (dialog != null)
     {
         dialog.Dismiss();
     }
     Handler.TrySetResult(which);
 }
Beispiel #13
0
        public void OnClick(IDialogInterface dialog, int which)
        {
            var resGoalTime = GoalTimeDao.GetGoalTime();

            if (resGoalTime == null)
            {
                return;
            }
            switch (resGoalTime.Name)
            {
            case "Year":
                InputMethodManager imm = (InputMethodManager)Singleton.Instance.GoalActivity.GetSystemService(Context.InputMethodService);
                imm.HideSoftInputFromWindow(Singleton.Instance.AddGoalView.WindowToken, HideSoftInputFlags.None);

                GoalDao.Insert(Singleton.Instance.AddGoalEditText.Text);
                //GoalUtils.GetGoal();
                dialog.Dismiss();
                break;

            case "Month":
                foreach (var item in Singleton.Instance.GoalCheckBoxs)
                {
                    CheckBox chk = item.CheckBox;
                    if (chk.Checked)
                    {
                        GoalOfMonthDao.Insert(item.IDGoal, Singleton.Instance.IDMonth);
                    }
                }
                //GoalUtils.GetGoal();
                dialog.Dismiss();
                break;

            case "Day":
                foreach (var item in Singleton.Instance.GoalCheckBoxs)
                {
                    CheckBox chk = item.CheckBox;
                    if (chk.Checked)
                    {
                        GoalOfDayDao.Insert(item.IDGoal, Singleton.Instance.IDDay);
                    }
                }
                //GoalUtils.GetGoal();
                dialog.Dismiss();
                break;
            }
        }
Beispiel #14
0
        public void OnCancel(IDialogInterface dialog)
        {
            if (dialog == null)
            {
                return;
            }

            dialog.Dismiss();
        }
Beispiel #15
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     switch (which)
     {
     case (int)DialogButtonType.Neutral:
         dialog.Dismiss();
         break;
     }
 }
Beispiel #16
0
            public void OnClick(IDialogInterface dialog, int which)
            {
                string password = currentPasswordField.Text;

                if (preferences.GetMasterPassword() == password)
                {
                    that.BuildNewCredentialsDialog().Show();
                    dialog.Dismiss();
                }
            }
 public void OnClick(IDialogInterface dialog, int which)
 {
     dialog.Dismiss();
     if (which == -1)
     {
         Log.Debug(TagDelete, $"\"{Item}\" Deleted");
         OnDelete();
         (Activity as IItemFragmentListener <T>)?.ItemDeleted(Item);
     }
 }
Beispiel #18
0
        // Overridden from IDialogInterfaceOnClickListener
        public void OnClick(IDialogInterface dialog, int position)
        {
            var action = content[position].action;

            if (action != null)
            {
                action();
            }
            dialog.Dismiss();
        }
        void IDialogInterfaceOnClickListener.OnClick(IDialogInterface dialog, int which)
        {
            if (which >= 0 && RadioSelected != which)
            {
                RadioSelected = which;
                var radioValue = GetSelectedValue();
                OnUserValueChanged(radioValue);
            }

            dialog.Dismiss();
        }
Beispiel #20
0
        void IDialogInterfaceOnClickListener.OnClick(IDialogInterface dialog, int which)
        {
            if (which >= 0)
            {
                this.RadioSelected = which;
                string radioValue = GetSelectedValue();
                _value.Text = radioValue;
            }

            dialog.Dismiss();
        }
Beispiel #21
0
        public void OnClick(IDialogInterface dialog, int which)
        {
            dialog.Dismiss();

            UserName.Text = SaveName;
            EditName.Text = String.Empty;

            NotificationSwitch.Checked = SaveSwitchState;

            EditingItemsVisible(ViewStates.Invisible, ViewStates.Visible);
            isEditing = false;
        }
Beispiel #22
0
        public void OnClick(IDialogInterface dialog, int which)
        {
            switch ((DialogButtonType)which)
            {
            case DialogButtonType.Positive:
                DeleteData();
                break;

            default:
                dialog.Dismiss();
                break;
            }
        }
Beispiel #23
0
        public void OnClick(IDialogInterface dialog, int which)
        {
            switch ((DialogButtonType)which)
            {
            case DialogButtonType.Neutral:
                controller.ImageDeleted();
                break;

            default:
                dialog.Dismiss();
                break;
            }
        }
Beispiel #24
0
        void IDialogInterfaceOnClickListener.OnClick(IDialogInterface dialog, int which)
        {
            if (which >= 0 && RadioSelected != which)
            {
                RadioSelected = which;
                var radioValue = GetSelectedValue();
#warning This radio selection is a bit of a mess currently - both radio value and RadioSelected change...
                RadioSelectedChanged?.Invoke(this, EventArgs.Empty);
                OnUserValueChanged(radioValue);
            }

            dialog.Dismiss();
        }
Beispiel #25
0
        public bool OnKey(IDialogInterface dialog, Keycode keyCode, KeyEvent e)
        {
            if (e.Action != KeyEventActions.Down && keyCode == Keycode.Back)
            {
                if (GoBack())
                {
                    return(false);
                }

                dialog.Dismiss();
            }

            return(true);
        }
        void IDialogInterfaceOnClickListener.OnClick(IDialogInterface dialog, int which)
        {
            if (which >= 0 && RadioSelected != which)
            {
                RadioSelected = which;
                var radioValue = GetSelectedValue();
                _value.Text = radioValue;

                if (RadioSelectionChanged != null)
                {
                    RadioSelectionChanged(this, EventArgs.Empty);
                }
            }

            dialog.Dismiss();
        }
Beispiel #27
0
            public void OnClick(IDialogInterface dialog, int which)
            {
                int  numOfDatasets = numberOfDatasetsPicker.Value;
                bool success       = that.BuildAndSaveMockedAutofillFieldCollection(
                    that, numOfDatasets);

                dialog.Dismiss();
                if (success)
                {
                    Snackbar.Make(that.FindViewById(Resource.Id.settings_layout),
                                  that.Resources.GetQuantityString(
                                      Resource.Plurals.settings_add_data_success, numOfDatasets,
                                      numOfDatasets),
                                  Snackbar.LengthShort).Show();
                }
            }
Beispiel #28
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dialog"></param>
        /// <param name="which"></param>
        public void OnClick(IDialogInterface dialog, int position)
        {
            switch (position)
            {
            case 0:
                UploadFromCamera();
                break;

            case 1:
                Toast.MakeText(this, "You clicked position 1", ToastLength.Long).Show();
                break;

            case 2:
                dialog.Dismiss();
                break;
            }
        }
        public void OnClick(IDialogInterface dialog, int which)
        {
            switch ((DialogButtonType)which)
            {
            case DialogButtonType.Positive:
                controller.UserSetData(picker.DateTime.ToFileTimeUtc().ToString());
                break;

            case DialogButtonType.Neutral:
                controller.UserSetData(null);
                break;

            default:
                dialog.Dismiss();
                break;
            }
        }
Beispiel #30
0
        public async void OnClick(IDialogInterface dialog, int which)
        {
            switch (which)
            {
            case (int)DialogButtonType.Neutral:
                dialog.Dismiss();
                NumberOfPoints.Text      = String.Empty;
                SendPointsButton.Enabled = false;
                break;

            case (int)DialogButtonType.Positive:
                try
                {
                    ProfileDatabase pdb = new ProfileDatabase();
                    if (Convert.ToInt64(NumberOfPoints.Text) > pdb.GetProfile().distribute)
                    {
                        Toast.MakeText(this, "Unavailible points amount.", ToastLength.Short).Show();
                        break;
                    }
                }
                catch (Exception) { Toast.MakeText(this, "Too many points to send.", ToastLength.Short).Show(); break; }

                ProgressDialog progressDialog = ProgressDialog.Show(this, "", "Sending points...", true);

                String name = userNameToDistribute.Text;
                userNameToDistribute.Text = String.Empty;
                String number = NumberOfPoints.Text;
                NumberOfPoints.Text = String.Empty;
                String notes = Notes.Text;

                Profile p = await MeritMoneyBrain.DistributePoints(number, userIDtoDistribute, notes);

                p.AvatarIsDefault = OperationWithBitmap.isDefault(p.imageUri);
                ProfileDatabase db = new ProfileDatabase();
                db.Update(p);

                new UpdateProfileData(this, progressDialog, number, name).Execute(p);
                break;
            }
        }
Beispiel #31
0
		public void OnCancel(IDialogInterface dialog)
		{
			dialog.Dismiss ();
			this._mUploadMessage.OnReceiveValue (null);
			this._mUploadMessage = null;
		}
Beispiel #32
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     dialog.Dismiss();
 }
 public void OnClick(IDialogInterface dialog, int which)
 {
     abortUnless(which == (int)DialogInterface.ButtonPositive, "lolwat?");
     dialog.Dismiss();
     outerInstance.connectToRoom(roomInput.Text.ToString());
 }
Beispiel #34
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     dialog.Dismiss();
 }
 public void OnClick(IDialogInterface dialog, int which)
 {
     dialog.Dismiss();
     BaiduMapNavigation.GetLatestBaiduMapApp(naviDemo);
 }
 public void OnClick(IDialogInterface dialog, DialogInterfaceButton which)
 {
     dialog.Dismiss();
     _alertCallback();
 }