namespace SHNDecryptHK { using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; public class columnDeletion : Form { private Button button1; private ComboBox comboBox1; private IContainer components; private frmMain mainfrm; private TextBox txtList; public columnDeletion(frmMain main) { this.mainfrm = main; this.InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { if (MessageBox.Show("Are you sure you want to delete this column? It can't be undone!", "SHN", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { this.mainfrm.file.DeleteColumn(this.comboBox1.SelectedItem.ToString()); } } catch (Exception exception) { MessageBox.Show(exception.Message); } } protected override void Dispose(bool disposing) { if (disposing && (this.components != null)) { this.components.Dispose(); } base.Dispose(disposing); } public void init() { if (this.mainfrm.file.table != null) { this.comboBox1.Items.Clear(); for (int i = 0; i < this.mainfrm.file.table.Columns.Count; i++) { this.comboBox1.Items.Add(this.mainfrm.file.table.Columns[i].ColumnName); this.txtList.Text = this.txtList.Text + this.mainfrm.file.table.Columns[i].ColumnName + "\r\n"; } this.comboBox1.SelectedIndex = 0; } } private void InitializeComponent() { ComponentResourceManager manager = new ComponentResourceManager(typeof(columnDeletion)); this.comboBox1 = new ComboBox(); this.button1 = new Button(); this.txtList = new TextBox(); base.SuspendLayout(); this.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; this.comboBox1.FormattingEnabled = true; this.comboBox1.Location = new Point(15, 0x10); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new Size(300, 0x15); this.comboBox1.TabIndex = 0; this.button1.Location = new Point(15, 0x16a); this.button1.Name = "button1"; this.button1.Size = new Size(300, 30); this.button1.TabIndex = 1; this.button1.Text = "Delete"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new EventHandler(this.button1_Click); this.txtList.Location = new Point(15, 0x2b); this.txtList.Multiline = true; this.txtList.Name = "txtList"; this.txtList.ScrollBars = ScrollBars.Vertical; this.txtList.Size = new Size(300, 0x139); this.txtList.TabIndex = 3; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; base.ClientSize = new Size(0x14c, 0x197); base.Controls.Add(this.txtList); base.Controls.Add(this.button1); base.Controls.Add(this.comboBox1); base.FormBorderStyle = FormBorderStyle.FixedSingle; base.Icon = (Icon) manager.GetObject("$this.Icon"); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "columnDeletion"; base.StartPosition = FormStartPosition.CenterParent; this.Text = "Column Deletion"; base.ResumeLayout(false); base.PerformLayout(); } } }