public override void Evaluate()
 {
     if (OnYes != null)
     {
         OnYes.Evaluate();
     }
 }
示例#2
0
 public override void Awake()
 {
     base.Awake();
     yesButton.OnSelect.AddListener(() => { onYes?.Invoke(); OnYes?.Invoke(); gameObject.SetActive(false); });
     noButton.OnSelect.AddListener(() => { onNo?.Invoke(); OnNo?.Invoke(); gameObject.SetActive(false); });
     yesButton.OnDeselect.AddListener(() => { onYes?.Invoke(); OnYes?.Invoke(); gameObject.SetActive(false); });
     noButton.OnDeselect.AddListener(() => { onNo?.Invoke(); OnNo?.Invoke(); gameObject.SetActive(false); });
 }
示例#3
0
 public void InitializeOk(string message, string title, OnYes onYes, bool cancelable = false)
 {
     _message    = message;
     _title      = title;
     _onYes      = onYes;
     _cancelable = cancelable;
     _dialogType = DialogType.OK;
 }
示例#4
0
        public override void HandleMediation()
        {
            base.HandleMediation();

            okButton.OnClick.AddListener(() => OnOk.Dispatch());
            yesButton.OnClick.AddListener(() => OnYes.Dispatch());
            noButton.OnClick.AddListener(() => OnNo.Dispatch());
        }
 public override void Evaluate()
 {
     base.Evaluate();
     if (OnYes != null)
     {
         OnYes.Evaluate();
     }
     //SendOPToNewUser();
 }
示例#6
0
 public override void Evaluate()
 {
     base.Evaluate();
     SendNIToOldUser();
     if (OnYes != null)
     {
         OnYes.Evaluate();
     }
 }
示例#7
0
 public void InitializeYesNo(string message, string title, OnYes onYes, OnNo onNo, bool cancelable = false)
 {
     _message    = message;
     _title      = title;
     _onYes      = onYes;
     _onNo       = onNo;
     _cancelable = cancelable;
     _dialogType = DialogType.YesNo;
 }
示例#8
0
 private void DoOnYes(object sender, EventArgs e)
 {
     if (OnYes != null)
     {
         OnYes.DoAction(Ability);
     }
     else
     {
         Triggers.FinishTrigger();
     }
 }
示例#9
0
        protected override void Run()
        {
            MessageBoxResult result = System.Windows.MessageBox.Show(Window.GetWindow(this), Message, Title, Buttons, Image, DefaultButton);

            Reset();
            OnResult?.ExecuteIfPossible(result);
            switch (result)
            {
            case MessageBoxResult.OK: OnOk?.ExecuteIfPossible(null); break;

            case MessageBoxResult.Cancel: OnCancel?.ExecuteIfPossible(null); break;

            case MessageBoxResult.Yes: OnYes?.ExecuteIfPossible(null); break;

            case MessageBoxResult.No: OnNo?.ExecuteIfPossible(null); break;
            }
        }
示例#10
0
        private void Create(string message)
        {
            IsDialog = true;
            Message  = message;
            var count      = 0;
            var lines      = BasicOne.SplitToLines(message, Width - 2);
            var enumerable = lines as string[] ?? lines.ToArray();

            Height   = enumerable.Length + 3;
            PostionY = ParentWindow.Height / 2 - Height / 2;
            foreach (var l in enumerable)
            {
                var messageLabel = new Label(l, 1, 2 + count, this);
                Inputs.Add(messageLabel);
                count++;
            }


            /*
             * var messageLabel = new Label(Message, PostionX + 2, PostionY + 2, "messageLabel", this);
             * messageLabel.BackgroundColour = BackgroundColour;*/

            _yesBtn = new Button(Width - 9, Height, "YES", this)
            {
                Action = () =>
                {
                    OnYes?.Invoke();
                    ExitWindow();
                }
            };
            _noBtn = new Button(Width - 4, Height, "NO", this)
            {
                Action = () =>
                {
                    OnNo?.Invoke();
                    ExitWindow();
                }
            };

            Inputs.Add(_yesBtn);
            Inputs.Add(_noBtn);

            CurrentlySelected = _yesBtn;
        }
示例#11
0
 public virtual void Evaluate()
 {
     if (Condition == null)
     {
         return;
     }
     if (Condition.IsValid)
     {
         if (OnYes != null)
         {
             OnYes.Evaluate();
         }
     }
     else
     {
         if (OnNo != null)
         {
             OnNo.Evaluate();
         }
     }
 }
示例#12
0
        private void CtrlBtnEdit_Click(object sender, EventArgs e)
        {
            string text = "";
            bool   flag = true;

            while (flag)
            {
                text = RenameForm.Invoke(false, _text);
                if (text != "")
                {
                    flag = false;
                }
                else
                {
                    MessageBox.Show("Если нужно удалить запись - выбирайте опцию" +
                                    " \"Удалить\". Пустые значения вводить нельзя.");
                }
            }
            DialogResult = DialogResult.OK;
            OnYes?.Invoke(text);
            Close();
        }
示例#13
0
 public override void Evaluate()
 {
     base.Evaluate();
     SendOPToV7();
     OnYes.Evaluate();
 }
示例#14
0
 private void button_Yes_Click(object sender, EventArgs e)
 {
     _isOk = true;
     OnYes?.Invoke();
     FinishForm();
 }