コード例 #1
0
        private void assembleButton_Click(object sender, EventArgs e)
        {
            preComCheck = null;
            CompError c = new CompError();
            int       off;
            bool      success = Utility.OffsetStringToInt(offsetBox.Text, out off);

            if (success)
            {
                insertOffset = off;
                bool syntaxPass = false;
                preComCheck = new BinFile(asm.AssembleASM(off, mainTextBox.Text, ref c, out syntaxPass));

                if (!syntaxPass)
                {
                    Error.ShowErrorMessage(c);
                    gcheckSuccess = false;
                }
                else if (preComCheck.Length != 0)
                {
                    string message = "Are you sure you want to insert this code?";
                    message += "\n" + "Offset: $" + insertOffset.ToString("X") + "  Size: $" + preComCheck.Length.ToString("X") + " byte(s)";
                    if (MessageBox.Show(message, "Confirm Insertion", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                    {
                        baseFile.ModifyFile(insertOffset, preComCheck);
                        this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    }
                }
            }
        }