private void button_FileNew_Click(object sender, RoutedEventArgs e)
        {
            if (PromptToSaveChanges())
            {
            }   //cancel the operation
            else
            {
                SuspendEngine();
                //TODO: the following line unconditionally clobbers the current network
                //so the cancel button in the dialog won't work properly
                //CreateEmptyNetwork(); // to avoid keeping too many bytes occupied...

                // and make sure we have maximum memory free...
                GC.Collect();
                GC.WaitForPendingFinalizers();
                UpdateFreeMem();
                NewArrayDlg dlg = new NewArrayDlg();
                dlg.ShowDialog();
                if (dlg.returnValue)
                {
                    arrayView.Dp.NeuronDisplaySize = 62;
                    ButtonZoomToOrigin_Click(null, null);
                    currentFileName = "";
                    SetCurrentFileNameToProperties();
                    SetTitleBar();
                    if (theNeuronArray.networkNotes != "")
                    {
                        MenuItemNotes_Click(null, null);
                    }
                }
                Update();
                ResumeEngine();
            }
        }
 private void button_FileNew_Click(object sender, RoutedEventArgs e)
 {
     if (PromptToSaveChanges())
     {
     }   //cancel the operation
     else
     {
         SuspendEngine();
         NewArrayDlg dlg = new NewArrayDlg();
         dlg.ShowDialog();
         if (dlg.returnValue)
         {
             arrayView.Dp.NeuronDisplaySize = 62;
             ButtonZoomToOrigin_Click(null, null);
             currentFileName = "";
             SetCurrentFileNameToProperties();
             setTitleBar();
             if (theNeuronArray.networkNotes != "")
             {
                 MenuItemNotes_Click(null, null);
             }
         }
     }
     ResumeEngine();
 }
Example #3
0
 private void button_FileNew_Click(object sender, RoutedEventArgs e)
 {
     if (PromptToSaveChanges())
     {
     }   //cancel the operation
     else
     {
         SuspendEngine();
         NewArrayDlg dlg = new NewArrayDlg();
         dlg.ShowDialog();
         if (dlg.returnValue)
         {
             theNeuronArrayView.Update();
             currentFileName = "";
             Properties.Settings.Default["CurrentFile"] = currentFileName;
             Properties.Settings.Default.Save();
             setTitleBar();
             if (theNeuronArray.networkNotes != "")
             {
                 MenuItemNotes_Click(null, null);
             }
         }
     }
     ResumeEngine();
 }