namespace SHNDecryptHK { using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; public class columnDivide : Form { private Button btnGo; private ComboBox comboBox1; private IContainer components; private frmMain frmColDivide; private GroupBox groupBox1; private Label label1; private TextBox txtFactor; public columnDivide(frmMain form) { this.frmColDivide = form; this.InitializeComponent(); } private void btnGo_Click(object sender, EventArgs e) { int num = this.frmColDivide.file.getColIndex(this.comboBox1.Items[this.comboBox1.SelectedIndex].ToString()); if (num >= 0) { double num2 = 0.0; try { num2 = double.Parse(this.txtFactor.Text); } catch (Exception exception) { MessageBox.Show(exception.Message); return; } string str = this.frmColDivide.file.table.Columns[num].DataType.ToString(); for (int i = 0; i < this.frmColDivide.file.table.Rows.Count; i++) { try { string str2 = str; if (str2 == null) { goto Label_0239; } if (!(str2 == "System.UInt16")) { if (str2 == "System.UInt32") { goto Label_0136; } if (str2 == "System.SByte") { goto Label_018E; } if (str2 == "System.Byte") { goto Label_01E5; } goto Label_0239; } this.frmColDivide.file.table.Rows[i][num] = (ushort) (((double) ((ushort) this.frmColDivide.file.table.Rows[i][num])) / num2); continue; Label_0136: this.frmColDivide.file.table.Rows[i][num] = (uint) (((double) ((uint) this.frmColDivide.file.table.Rows[i][num])) / num2); continue; Label_018E: this.frmColDivide.file.table.Rows[i][num] = (sbyte) (((double) ((sbyte) this.frmColDivide.file.table.Rows[i][num])) / num2); continue; Label_01E5: this.frmColDivide.file.table.Rows[i][num] = (byte) (((double) ((byte) this.frmColDivide.file.table.Rows[i][num])) / num2); continue; Label_0239: this.frmColDivide.file.table.Rows[i][num] = (int) (((double) ((int) this.frmColDivide.file.table.Rows[i][num])) / num2); } catch (Exception exception2) { MessageBox.Show(exception2.Message); break; } } this.frmColDivide.SQLStatus.Text = this.comboBox1.SelectedItem.ToString() + " column has been divided by " + num2.ToString() + "."; } } private void columnDivide_Load(object sender, EventArgs e) { if (this.frmColDivide.file == null) { base.Close(); } else { this.init(); } } protected override void Dispose(bool disposing) { if (disposing && (this.components != null)) { this.components.Dispose(); } base.Dispose(disposing); } public void init() { if (this.frmColDivide.file.table != null) { this.comboBox1.Items.Clear(); for (int i = 0; i < this.frmColDivide.file.table.Columns.Count; i++) { this.comboBox1.Items.Add(this.frmColDivide.file.table.Columns[i].ColumnName); } this.comboBox1.SelectedIndex = 0; } } private void InitializeComponent() { ComponentResourceManager manager = new ComponentResourceManager(typeof(columnDivide)); this.groupBox1 = new GroupBox(); this.btnGo = new Button(); this.txtFactor = new TextBox(); this.label1 = new Label(); this.comboBox1 = new ComboBox(); this.groupBox1.SuspendLayout(); base.SuspendLayout(); this.groupBox1.Controls.Add(this.btnGo); this.groupBox1.Controls.Add(this.txtFactor); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Location = new Point(12, 0x27); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new Size(0xde, 0x51); this.groupBox1.TabIndex = 7; this.groupBox1.TabStop = false; this.groupBox1.Text = "Divide:"; this.btnGo.Location = new Point(0x34, 0x30); this.btnGo.Name = "btnGo"; this.btnGo.Size = new Size(0xa4, 0x1a); this.btnGo.TabIndex = 6; this.btnGo.Text = "Go"; this.btnGo.UseVisualStyleBackColor = true; this.btnGo.Click += new EventHandler(this.btnGo_Click); this.txtFactor.Location = new Point(0x34, 0x16); this.txtFactor.Name = "txtFactor"; this.txtFactor.Size = new Size(0xa4, 20); this.txtFactor.TabIndex = 5; this.txtFactor.Text = "1"; this.label1.AutoSize = true; this.label1.Location = new Point(6, 0x19); this.label1.Name = "label1"; this.label1.Size = new Size(40, 13); this.label1.TabIndex = 4; this.label1.Text = "Factor:"; this.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; this.comboBox1.FormattingEnabled = true; this.comboBox1.Location = new Point(12, 12); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new Size(0xde, 0x15); this.comboBox1.TabIndex = 6; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; base.ClientSize = new Size(0xf9, 0x84); base.Controls.Add(this.groupBox1); base.Controls.Add(this.comboBox1); base.FormBorderStyle = FormBorderStyle.FixedSingle; base.Icon = (Icon) manager.GetObject("$this.Icon"); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "columnDivide"; base.StartPosition = FormStartPosition.CenterParent; this.Text = "Column Division"; base.Load += new EventHandler(this.columnDivide_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); base.ResumeLayout(false); } } }