Exemple #1
0
        private Crownwood.Magic.Controls.TabPage CreateTabPage(Run run)
        {
            CheckRemoveBlankTab();

            Crownwood.Magic.Controls.TabPage tpActive = null;

            // Does it exist already?
            foreach (Crownwood.Magic.Controls.TabPage tp in _tcProfilers.TabPages)
            {
                if (tp.Tag == run)
                {
                    _tcProfilers.SelectedTab = tp;
                    tpActive = tp;
                    break;
                }
            }

            if (tpActive == null)
            {
                tpActive     = new Crownwood.Magic.Controls.TabPage(run.Project.Name + " [" + run.StartTime + "]");
                tpActive.Tag = run;
                _tcProfilers.TabPages.Add(tpActive);
                _tcProfilers.SelectedTab = tpActive;
            }

            if (run.State == Run.RunState.Finished &&
                run.Success &&
                (tpActive.Controls.Count == 0 || !(tpActive.Controls[0] is ProfilerControl)))
            {
                tpActive.Controls.Clear();
                ProfilerControl pc = new ProfilerControl();
                pc.Dock = DockStyle.Fill;
                tpActive.Controls.Add(pc);
                pc.ProfilerRun = run;
            }

            // Catch non-successful finished runs here too
            if (((run.State == Run.RunState.Finished && !run.Success) ||
                 run.State == Run.RunState.Running ||
                 run.State == Run.RunState.Initializing) &&
                (tpActive.Controls.Count == 0 || !(tpActive.Controls[0] is ProfilerRunControl)))
            {
                tpActive.Controls.Clear();
                ProfilerRunControl pc = new ProfilerRunControl();
                pc.Dock = DockStyle.Fill;
                tpActive.Controls.Add(pc);
                pc.ProfilerRun = run;
            }

            return(tpActive);
        }
Exemple #2
0
        private Crownwood.Magic.Controls.TabPage CreateTabPage( Run run )
        {
            CheckRemoveBlankTab();

            Crownwood.Magic.Controls.TabPage tpActive = null;

            // Does it exist already?
            foreach ( Crownwood.Magic.Controls.TabPage tp in _tcProfilers.TabPages )
            {
                if ( tp.Tag == run )
                {
                    _tcProfilers.SelectedTab = tp;
                    tpActive = tp;
                    break;
                }
            }

            if ( tpActive == null )
            {
                tpActive = new Crownwood.Magic.Controls.TabPage( run.Project.Name + " [" + run.StartTime + "]" );
                tpActive.Tag = run;
                _tcProfilers.TabPages.Add( tpActive );
                _tcProfilers.SelectedTab = tpActive;
            }

            if ( run.State == Run.RunState.Finished
                && run.Success
                && ( tpActive.Controls.Count == 0 || !( tpActive.Controls[ 0 ] is ProfilerControl ) ) )
            {
                tpActive.Controls.Clear();
                ProfilerControl pc = new ProfilerControl();
                pc.Dock = DockStyle.Fill;
                tpActive.Controls.Add( pc );
                pc.ProfilerRun = run;
            }

            // Catch non-successful finished runs here too
            if ( ( ( run.State == Run.RunState.Finished && !run.Success )
                        || run.State == Run.RunState.Running
                        || run.State == Run.RunState.Initializing )
                && ( tpActive.Controls.Count == 0 || !( tpActive.Controls[ 0 ] is ProfilerRunControl ) ) )
            {
                tpActive.Controls.Clear();
                ProfilerRunControl pc = new ProfilerRunControl();
                pc.Dock = DockStyle.Fill;
                tpActive.Controls.Add( pc );
                pc.ProfilerRun = run;
            }

            return tpActive;
        }