コード例 #1
0
ファイル: OKBox.cs プロジェクト: roridev/ModManager
        public OKBox(string question) : base("TextInputBox") {

            X = Pos.Center();
            Y = Pos.Center();
            Width = Dim.Percent(40);
            Height = Dim.Percent(20);
            ColorScheme = Colors.Menu;
            lbl = new(question) {
                Width = Dim.Fill(),
                Y = 1,
                TextAlignment = TextAlignment.Centered
            };

            ok = new("OK") {
                X = Pos.Center(),
                Y = 5
            };

            ok.Clicked += () => {
                OkClicked?.Invoke(this, null);
            };

            Add(lbl, ok);
        }
}}
コード例 #2
0
ファイル: TextCheckBox.cs プロジェクト: roridev/ModManager
        public TextCheckBox(string question, params ustring[] labels) : base("TextCheckBox")
        {
            var str = "";

            X           = Pos.Center();
            Y           = Pos.Center();
            Width       = Dim.Percent(40);
            Height      = Dim.Percent(20);
            ColorScheme = Colors.Menu;
            lbl         = new(question) {
                Width         = Dim.Fill(),
                Y             = 1,
                TextAlignment = TextAlignment.Centered
            };

            input = new(labels) {
                Width = Dim.Fill(),
                Y     = 3
            };

            ok = new("OK") {
                X = Pos.Center(),
                Y = 5
            };

            ok.Clicked += () => {
                OkClicked?.Invoke(this, input.SelectedItem);
            };

            Add(lbl, input, ok);
        }
コード例 #3
0
 private void OkButtonClick(object sender, RoutedEventArgs e)
 {
     if (OkClicked != null)
     {
         OkClicked.Invoke(this, EventArgs.Empty);
     }
 }
コード例 #4
0
 public static void Handle(Exception error)
 {
     Sound.PlaySounds = false;
     if (MessageBox.Show(ErrorMessage(error), "There's been an error.", MessageBoxButtons.OK, MessageBoxIcon.Error) ==
         (DialogResult.OK | DialogResult.None))
     {
         OkClicked?.Invoke();
     }
 }
コード例 #5
0
        public void Show(string title, string message)
        {
            var builder = new AlertDialog.Builder(_context);

            builder
            .SetMessage(message)
            .SetTitle(title)
            .SetNeutralButton("OK", (sender, args) => { OkClicked?.Invoke(this, EventArgs.Empty); })
            .Show();
        }
コード例 #6
0
 private void okRadButton_Click(object sender, RoutedEventArgs e)
 {
     if (Validate())
     {
         OkClicked?.Invoke();
         _viewModel.Add();
         _viewModel.Save();
         Close();
     }
 }
コード例 #7
0
 void onFileSelect(object sender, MouseButtonEventArgs e)
 {
     if (string.IsNullOrEmpty(SelectedFile))
     {
         CurrentDirectory = SelectedDirectory;
     }
     else
     {
         OkClicked.Raise(this, null);
         IFace.DeleteWidget(this);
     }
 }
コード例 #8
0
ファイル: FileDialog.cs プロジェクト: slagusev/Crow
 void onFileSelect(object sender, MouseButtonEventArgs e)
 {
     if (string.IsNullOrEmpty(SelectedFile))
     {
         CurrentDirectory = SelectedDirectory;
     }
     else
     {
         OkClicked.Raise(this, null);
         unloadDialog((sender as GraphicObject).CurrentInterface);
     }
 }
コード例 #9
0
        public EditUserPasswordView(UserBase user)
        {
            InitializeComponent();

            tbPassword.PasswordChanged       += (o, e) => Validate();
            tbPasswordRepeat.PasswordChanged += (o, e) => Validate();

            btApply.Click += (o, e) => {
                user.PasswordHash = Lazurite.Windows.Utils.CryptoUtils.CreatePasswordHash(tbPassword.Password);
                OkClicked?.Invoke();
            };

            Validate();
        }
コード例 #10
0
        public AddGroupView(UserGroupBase group)
        {
            InitializeComponent();

            tbName.TextChanged += (o, e) => Validate();

            btApply.Click += (o, e) => {
                group.Name = tbName.Text.Trim();
                OkClicked?.Invoke();
            };

            tbName.Text = group.Name;

            Validate();
        }
コード例 #11
0
ファイル: Confirmation.cs プロジェクト: x5f3759df/Citrus
        public Confirmation(string text, bool cancelButtonVisible = true)
        {
            var label = Scene._Title.It;

            label.OverflowMode = TextOverflowMode.Minify;
            label.Text         = text;

            var cancel = Scene._BtnCancel.It;

            cancel.Visible          = cancelButtonVisible;
            cancel.Clicked          = Close;
            Scene._BtnOk.It.Clicked = () => {
                OkClicked?.Invoke();
                Close();
            };
        }
コード例 #12
0
        public EditUserView(UserBase user)
        {
            InitializeComponent();

            tbLogin.Validation   = (v) => v.OutputString = v.InputString.Replace(" ", "");
            tbLogin.TextChanged += (o, e) => Validate();
            tbName.TextChanged  += (o, e) => Validate();

            btApply.Click += (o, e) => {
                user.Name  = tbName.Text.Trim();
                user.Login = tbLogin.Text;
                OkClicked?.Invoke();
            };

            tbLogin.Text = user.Login;
            tbName.Text  = user.Name;

            Validate();
        }
コード例 #13
0
        public void AfterClose()
        {
            int IndentSize;

            IndentSize = System.Diagnostics.Debug.IndentSize;
            System.Diagnostics.Debug.WriteLine(IndentSize);

            if (CloseReason == swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay)
            {
                OkClicked?.Invoke();
                CloseCommand?.Execute(null);
            }
            else
            {
                CloseCommand?.Execute(-1);
            }
            Closed?.Invoke(CloseReason);

            SldControls.ForEach(p => p.SldControlVisibility = false);

            this.Dispose();
        }
コード例 #14
0
ファイル: TextInputBox.cs プロジェクト: roridev/ModManager
        public TextInputBox(string question) : base("TextInputBox")
        {
            var str = "";

            X           = Pos.Center();
            Y           = Pos.Center();
            Width       = Dim.Percent(40);
            Height      = Dim.Percent(20);
            ColorScheme = Colors.Menu;
            lbl         = new(question) {
                Width         = Dim.Fill(),
                Y             = 1,
                TextAlignment = TextAlignment.Centered
            };

            input = new() {
                Width = Dim.Fill(),
                Y     = 3
            };

            ok = new("OK") {
                X = Pos.Center(),
                Y = 5
            };

            ok.Clicked += () => {
                OkClicked?.Invoke(this, input.Text.ToString());
            };

            input.KeyUp += (k) => {
                if (k.KeyEvent.Key == Key.Enter)
                {
                    OkClicked?.Invoke(this, input.Text.ToString());
                }
            };

            Add(lbl, input, ok);
        }
コード例 #15
0
 private void Ok_Clicked(object sender, EventArgs e)
 {
     OkClicked?.Invoke();
     PopupNavigation.Instance.RemovePageAsync(this);
 }
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     ApplyChanges();
     OkClicked?.Invoke(this, e);
 }
コード例 #17
0
 private void okRadButton_Click(object sender, RoutedEventArgs e)
 {
     OkClicked?.Invoke();
     Close();
 }
コード例 #18
0
 private void OnOkClicked(object sender, EventArgs e)
 {
     OkClicked?.Invoke(this, e);
 }
コード例 #19
0
        private void OKButton_Clicked(object sender, EventArgs e)
        {
            OkClicked?.Invoke(this, new AddHairLengthDialogEventArgs(mHairLengthControl.GetHairLength(), AddNewHairLength));

            Navigation.PopPopupAsync();
        }
コード例 #20
0
 /// <summary>
 /// Fires the ok clicked event.
 /// </summary>
 protected virtual void OnOkClicked()
 {
     OkClicked?.Invoke(this, EventArgs.Empty);
 }