コード例 #1
0
ファイル: MainController.cs プロジェクト: golegen/6502bench
        private void FinishPrep()
        {
            string messages = mProject.LoadExternalFiles();

            if (messages.Length != 0)
            {
                // ProjectLoadIssues isn't quite the right dialog, but it'll do.
                ProjectLoadIssues dlg = new ProjectLoadIssues(messages,
                                                              ProjectLoadIssues.Buttons.Continue);
                dlg.ShowDialog();
            }

            mDisplayList = new DisplayListGen(mProject, mOutputFormatter, mPseudoOpNames);

            // Prep the symbol table subset object.  Replace the old one with a new one.
            //mSymbolSubset = new SymbolTableSubset(mProject.SymbolTable);

            RefreshProject(UndoableChange.ReanalysisScope.CodeAndData);
            //ShowProject();
            //InvalidateControls(null);
            mMainWin.ShowCodeListView = true;
            mNavStack.Clear();

            // Want to do this after ShowProject() or we see a weird glitch.
            UpdateRecentProjectList(mProjectPathName);
        }
コード例 #2
0
ファイル: MainController.cs プロジェクト: golegen/6502bench
        /// <summary>
        /// Closes the project and associated modeless dialogs.  Unsaved changes will be
        /// lost, so if the project has outstanding changes the user will be given the
        /// opportunity to cancel.
        /// </summary>
        /// <returns>True if the project was closed, false if the user chose to cancel.</returns>
        private bool DoClose()
        {
            Debug.WriteLine("ProjectView.DoClose() - dirty=" +
                            (mProject == null ? "N/A" : mProject.IsDirty.ToString()));
            if (mProject != null && mProject.IsDirty)
            {
                DiscardChanges dlg = new DiscardChanges();
                bool?          ok  = dlg.ShowDialog();
                if (ok != true)
                {
                    return(false);
                }
                else if (dlg.UserChoice == DiscardChanges.Choice.SaveAndContinue)
                {
                    if (!DoSave())
                    {
                        return(false);
                    }
                }
            }

#if false
            // Close modeless dialogs that depend on project.
            if (mShowUndoRedoHistoryDialog != null)
            {
                mShowUndoRedoHistoryDialog.Close();
            }
            if (mShowAnalysisTimersDialog != null)
            {
                mShowAnalysisTimersDialog.Close();
            }
            if (mShowAnalyzerOutputDialog != null)
            {
                mShowAnalyzerOutputDialog.Close();
            }
            if (mHexDumpDialog != null)
            {
                mHexDumpDialog.Close();
            }
#endif

            // Discard all project state.
            if (mProject != null)
            {
                mProject.Cleanup();
                mProject = null;
            }
            mDataPathName    = null;
            mProjectPathName = null;
#if false
            mSymbolSubset                = new SymbolTableSubset(new SymbolTable());
            mCodeViewSelection           = new VirtualListViewSelection();
            mDisplayList                 = null;
            codeListView.VirtualListSize = 0;
            //codeListView.Items.Clear();
            ShowNoProject();
            InvalidateControls(null);
#endif
            mMainWin.ShowCodeListView = false;

            mGenerationLog = null;

            // Not necessary, but it lets us check the memory monitor to see if we got
            // rid of everything.
            GC.Collect();

            return(true);
        }