Esempio n. 1
0
        private void menuFileOpen_Click(object sender, EventArgs e)
        {
            if (mFileModified)
            {
                if (MessageBox.Show(this, "You have unsaved changes.  Do you want to save them first?", APP_NAME, MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    return;
                }
            }

            if (openFileDialog1.ShowDialog(this) == DialogResult.Cancel || openFileDialog1.FileName == "")
            {
                return;
            }

            try
            {
                mDisk              = new CocoDisk(File.ReadAllBytes(openFileDialog1.FileName));
                mFileModified      = false;
                labelFileName.Text = openFileDialog1.FileName;
                UpdateFilesAndShowErrors();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "Error: " + ex.Message, APP_NAME);
                return;
            }
        }
Esempio n. 2
0
 private void buttonAcceptDisk_Click(object sender, EventArgs e)
 {
     if (mRecordBuffer.Count == 0)
     {
         MessageBox.Show("There is no data in the buffer");
         return;
     }
     try
     {
         Disk = new CocoDisk(mRecordBuffer.ToArray());
         mRecordBuffer.Clear();
         Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, "ERROR: " + ex.Message, FormCocoDisk.APP_NAME);
     }
 }
Esempio n. 3
0
        private void menuUtilitiesCocoTerminal_Click(object sender, EventArgs e)
        {
            if (mFileModified)
            {
                if (MessageBox.Show(this, "You have unsaved changes.  Do you want to save them first?", APP_NAME, MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    return;
                }
            }

            var form = new FormCocoCom();

            form.ShowDialog(this);
            if (form.Disk != null)
            {
                mDisk              = form.Disk;
                mFileModified      = true;
                labelFileName.Text = "";
                UpdateFilesAndShowErrors();
            }
        }