コード例 #1
0
        private void menuTableProperties_Click(object sender, EventArgs e)
        {
            ColumnInfoDialog cdialog = null;

            try
            {
                if (listView.SelectedItems.Count > 0)
                {
                    int index = listView.SelectedItems[0].Index;

                    cdialog = new ColumnInfoDialog(GeneratorContext.CurrentDatabaseTables[index]);

                    if (cdialog.ShowDialog() == DialogResult.OK)
                    {
                        GeneratorContext.CurrentDatabaseTables[index] = cdialog.Table;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error. " + ex.Message);
            }
            finally
            {
                if (cdialog != null)
                {
                    cdialog.Dispose();
                }
            }
        }
コード例 #2
0
ファイル: MainWindow.cs プロジェクト: mariusmg/DataBlock
        private void menuTableProperties_Click(object sender, EventArgs e)
        {
            ColumnInfoDialog cdialog = null;

            try
            {
                if (listView.SelectedItems.Count > 0)
                {
                    int index = listView.SelectedItems[0].Index;

                    cdialog = new ColumnInfoDialog(Context.databaseTables[index]);

                    if (cdialog.ShowDialog() == DialogResult.OK)
                    {
                        Context.databaseTables[index] = cdialog.Table;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (cdialog != null)
                {
                    cdialog.Dispose();
                }
            }
        }