Battle_Script_Pro.Form1.numericUpDown1_ValueChanged C# (CSharp) Метод

numericUpDown1_ValueChanged() приватный Метод

private numericUpDown1_ValueChanged ( object sender, EventArgs e ) : void
sender object
e EventArgs
Результат void
        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            if (selectedROMPath != null && !selectedROMPath.Equals(""))
            {
                byte[] rom = File.ReadAllBytes(selectedROMPath);
                string romCode = GetROMCode();
                string[] iniFile = File.ReadAllLines(System.Windows.Forms.Application.StartupPath + @"\Data\BattleScriptPro.ini");
                bool getValues = false;
                foreach (string s in iniFile)
                {
                    if (s.Equals("[" + romCode + "]"))
                    {
                        getValues = true;
                        continue;
                    }
                    if (getValues)
                    {
                        if (s.StartsWith("MoveEffectTable"))
                        {
                            uint value = 0;
                            bool success = UInt32.TryParse(s.Split('=')[1], out value);
                            if (!success)
                            {
                                success = UInt32.TryParse(ToDecimal(s.Split('=')[1]), out value);
                                if (!success)
                                {
                                    MessageBox.Show("Error parsing the move keyword value from the main ini. Are you sure it is formatted correctly as a number?");
                                }
                            }
                            moveEffectTableLocation = value;
                            getValues = false;
                            break;
                        }
                    }
                }
                string x = "";
                for (int i = 0; i < 4; i++)
                {
                    x += rom[((int)numericUpDown1.Value * 4) + moveEffectTableLocation + 3 - i].ToString("X2");
                }
                int theValue = 0;
                bool newSuccess = Int32.TryParse(ToDecimal("0x" + x), out theValue);
                if (!newSuccess)
                {
                    MessageBox.Show("There was a problem parsing the pointer from the ROM");
                }
                else
                {
                    theValue -= 0x08000000;
                    txtMoveEffectScriptLocation.Text = "0x" + theValue.ToString("X");
                }
            }
        }
Form1