Beispiel #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            tbcMain.TabPages[TBI_TEMPLATE].Controls.Add(vc);
            vc.BringToFront();

            tbcMain.TabPages[TBI_WORKSPACE].Controls.Add(resultsPanel);
            resultsPanel.BringToFront();

            tbcMain.SelectedIndexChanged += TbcMain_SelectedIndexChanged;
        }
Beispiel #2
0
        private void ResultsPanelCloseRequested(object sender, CloseRequestArgs e)
        {
            resultsPanel.Deactivate();
            resultsPanel.Dispose();

            resultsPanel      = new ResultsPanel();
            resultsPanel.Dock = DockStyle.Fill;

            resultsPanel.CloseRequested += ResultsPanelCloseRequested;

            tbcMain.TabPages[TBI_WORKSPACE].Controls.Add(resultsPanel);
            resultsPanel.BringToFront();
            tbcMain.SelectedIndex = TBI_WORKSPACE;

            switch (e.ClosingState)
            {
            case CloseRequestArgs.ClosingReason.RevertToIntro:
                ShowIntroDialog();
                break;

            case CloseRequestArgs.ClosingReason.ToLoadExisting:
                resultsPanel.OpenWorkspace();
                break;

            case CloseRequestArgs.ClosingReason.ApplicationExiting:
                tbcMain.SelectedIndex = TBI_TEMPLATE;
                if (vc.DoCloseTemplate())
                {
                    Application.Exit();
                }
                break;

            default:
                break;
            }
        }