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;
            }
        }
Exemplo n.º 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();
 }
Exemplo n.º 4
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     switch(which)
     {
         case IDialogInterfaceConstants.BUTTON_POSITIVE:
             doInBackground();
             dialog.Dismiss();
             break;
         default:
             dialog.Dismiss();
             break;
     }
 }
Exemplo n.º 5
0
        public void OnClick(IDialogInterface dialog, int which)
        {
            switch (which)
            {
            case IDialogInterfaceConstants.BUTTON_POSITIVE:
                doInBackground();
                dialog.Dismiss();
                break;

            default:
                dialog.Dismiss();
                break;
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
            }
Exemplo n.º 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();
        }
Exemplo n.º 10
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     SharedPrefsAutofillRepository.GetInstance().Clear(that);
     SharedPrefsPackageVerificationRepository.GetInstance().Clear(that);
     MyPreferences.GetInstance(that).ClearCredentials();
     dialog.Dismiss();
 }
Exemplo n.º 11
0
            public void OnClick(IDialogInterface dialog, int which)
            {
                string password = newPasswordField.Text;

                preferences.SetMasterPassword(password);
                dialog.Dismiss();
            }
Exemplo n.º 12
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     if (dialog != null)
     {
         dialog.Dismiss();
     }
     Handler.TrySetResult(which);
 }
Exemplo n.º 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;
            }
        }
Exemplo n.º 14
0
        public void OnCancel(IDialogInterface dialog)
        {
            if (dialog == null)
            {
                return;
            }

            dialog.Dismiss();
        }
Exemplo n.º 15
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     switch (which)
     {
     case (int)DialogButtonType.Neutral:
         dialog.Dismiss();
         break;
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 18
0
        // Overridden from IDialogInterfaceOnClickListener
        public void OnClick(IDialogInterface dialog, int position)
        {
            var action = content[position].action;

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

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

            dialog.Dismiss();
        }
Exemplo n.º 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;
        }
Exemplo n.º 22
0
        public void OnClick(IDialogInterface dialog, int which)
        {
            switch ((DialogButtonType)which)
            {
            case DialogButtonType.Positive:
                DeleteData();
                break;

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

            default:
                dialog.Dismiss();
                break;
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 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);
        }
Exemplo n.º 26
0
        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();
        }
Exemplo n.º 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();
                }
            }
Exemplo n.º 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;
            }
        }
Exemplo n.º 29
0
        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;
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 31
0
		public void OnCancel(IDialogInterface dialog)
		{
			dialog.Dismiss ();
			this._mUploadMessage.OnReceiveValue (null);
			this._mUploadMessage = null;
		}
Exemplo n.º 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());
 }
Exemplo n.º 34
0
 public void OnClick(IDialogInterface dialog, int which)
 {
     dialog.Dismiss();
 }
 public void OnClick(IDialogInterface dialog, int which)
 {
     dialog.Dismiss();
     BaiduMapNavigation.GetLatestBaiduMapApp(naviDemo);
 }
Exemplo n.º 36
0
 public void OnClick(IDialogInterface dialog, DialogInterfaceButton which)
 {
     dialog.Dismiss();
     _alertCallback();
 }