コード例 #1
0
 private void exitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         this.Close();
     }
     catch (Exception throwedException)
     {
         FormShowError errorForm = new FormShowError(throwedException);
         errorForm.ShowDialog(this);
     }
 }
コード例 #2
0
 private void menuItemSaveProject_Click(object sender, EventArgs e)
 {
     try
     {
         SaveFileDialog fileDialog = new SaveFileDialog();
         fileDialog.Filter = "ProjectFiles|*.xml";
         DialogResult dr = fileDialog.ShowDialog(this);
         if (dr == DialogResult.OK)
         {
             _comReader.SaveProject(fileDialog.FileName);
             MessageBox.Show("Project successfully saved.", this.GetType().Assembly.GetName().Name, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception throwedException)
     {
         FormShowError errorForm = new FormShowError(throwedException, "Failed to save Project Information.");
         errorForm.ShowDialog(this);
     }
 }
コード例 #3
0
 private void menuItemLoadProject_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog fileDialog = new OpenFileDialog();
         fileDialog.Filter = "ProjectFiles|*.xml";
         DialogResult dr = fileDialog.ShowDialog(this);
         if (dr == DialogResult.OK)
         {
             _comReader.LoadProject(fileDialog.FileName);
             OnTypeLibraryLoaded();
         }
     }
     catch (Exception throwedException)
     {
         FormShowError errorForm = new FormShowError(throwedException, "Failed to load Project Information.");
         errorForm.ShowDialog(this);
     }
 }