Ejemplo n.º 1
0
        private void SettingsEditNoteButton_Click(object sender, EventArgs e)
        {
            var item = SettingsDataGridView.SelectedRows
                       .Cast <DataGridViewRow>()
                       .Select(x => (Setting)x.DataBoundItem)
                       .FirstOrDefault();

            if (item == null)
            {
                return;
            }
            var note = item.Comment ?? "";
            var form = new PromptForm();

            form.EditTextBox.MaxLength = 1024;
            form.EditTextBox.Text      = note;
            form.StartPosition         = FormStartPosition.CenterParent;
            form.Text = "X360CE - Edit Note";
            var result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                item.Comment = form.EditTextBox.Text.Trim();
                UpdateNoteLabel();
            }
        }
Ejemplo n.º 2
0
        private void SettingsEditNoteButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var item = MainDataGrid.SelectedItems
                       .Cast <UserSetting>()
                       .FirstOrDefault();

            if (item == null)
            {
                return;
            }
            var note = item.Comment ?? "";
            var form = new PromptForm();

            form.EditTextBox.MaxLength = 1024;
            form.EditTextBox.Text      = note;
            form.StartPosition         = System.Windows.Forms.FormStartPosition.CenterParent;
            form.Text = "X360CE - Edit Note";
            ControlsHelper.CheckTopMost(form);
            var result = form.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                item.Comment = form.EditTextBox.Text.Trim();
                UpdateNoteLabel();
            }
        }