示例#1
0
 private void FinishForm()
 {
     if (!_isOk)
     {
         OnNo?.Invoke();
     }
     Close();
 }
示例#2
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;
        }