コード例 #1
0
ファイル: SettingsDialog.cs プロジェクト: RyanGrange/Ketarin
        private void bEdit_Click(object sender, EventArgs e)
        {
            if (olvCustomColumns.SelectedObject == null) return;

            int index = olvCustomColumns.SelectedIndex;

            KeyValuePair<string, string> selectedItem = (KeyValuePair<string, string>)olvCustomColumns.SelectedObject;
            using (AddCustomColumnDialog dialog = new AddCustomColumnDialog())
            {
                dialog.ColumnName = selectedItem.Key;
                dialog.ColumnValue = selectedItem.Value;
                dialog.Text = "Edit " + selectedItem.Key;

                if (dialog.ShowDialog(this) == DialogResult.OK)
                {
                    this.cachedCustomColumns.Remove(selectedItem.Key);
                    this.cachedCustomColumns[dialog.ColumnName] = dialog.ColumnValue;
                    this.olvCustomColumns.SetObjects(cachedCustomColumns);
                    this.olvCustomColumns.SelectedIndex = index;
                    this.customColumnsChanged = true;
                }
            }
        }
コード例 #2
0
ファイル: SettingsDialog.cs プロジェクト: RyanGrange/Ketarin
 private void bAddCustomColumn_Click(object sender, EventArgs e)
 {
     using (AddCustomColumnDialog dialog = new AddCustomColumnDialog())
     {
         if (dialog.ShowDialog(this) == DialogResult.OK)
         {
             this.cachedCustomColumns[dialog.ColumnName] = dialog.ColumnValue;
             this.olvCustomColumns.SetObjects(cachedCustomColumns);
             this.customColumnsChanged = true;
         }
     }
 }