示例#1
0
        public AssessmentToolStrip(ProcessType type) : this() {

            AMEManager cm = AMEManager.Instance;
            Controller projectController = (Controller)cm.Get("ProjectEditor");

            String typeString = null;
            switch (type) {
                case (ProcessType.SIMULATION):
                    this.config = "AssessmentEditor";
                    this.measureConfig = "SimMeasuresEditor";
                    this.assessmentController = (AssessmentController)cm.Get(this.config);
                    typeString = " for Simulation";
                    this.processButton.ToolTipText = "Simulation";
                    this.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                        this.processComboBox,
                        this.toolStripSeparator,
                        this.graphButton,
                        this.processButton});
                    break;

                case (ProcessType.OPTIMIZATION):
                    this.config = "OptAssessmentEditor";
                    this.measureConfig = "OptMeasuresEditor";
					this.assessmentController = (AssessmentController)cm.Get(this.config);
                    typeString = " for Optimization";
                    this.processButton.ToolTipText = "Optimization";
                    this.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                        this.processComboBox,
                        this.toolStripSeparator,
                        this.graphButton,
                        this.applyResultsButton,
						this.processButton});
                    break;

                default:
                    throw new Exception("Attempt to create an unkown type of the AssessmentToolstrip");
            }

            this.assessmentController.RegisterForUpdate(processComboBox);

            // Init Simulation Selection CustomCombo
            this.processComboBox.Controller = projectController;
            this.processComboBox.Type = assessmentController.RootComponentType;
            this.processComboBox.LinkType = projectController.RootComponentType;

            logger.Debug("Created AssessmentToolStrip" + typeString);
        }
示例#2
0
文件: VSGForm.cs 项目: wshanshan/DDD
        private void loadScreen(Controller c, ViewComponentPanel panel)
        {
            if (panel != previewVCP)
            {
                if (previewVCP != null)
                {
                    previewVCP.SuspendScene();
                }
            }



            if (databaseConnected)
            {
                if (scenarioId >= 0)
                {
                    // We might not want to load same page.
                    if (!toolStripContainer1.ContentPanel.Controls.Contains(panel))
                    {
                        DrawingUtility.SuspendDrawing(toolStripContainer1.ContentPanel);
                        toolStripContainer1.ContentPanel.Controls.Clear();
                        toolStripContainer1.ContentPanel.Controls.Add(panel);
                        DrawingUtility.ResumeDrawing(toolStripContainer1.ContentPanel);

                        c.UpdateView();
                    }
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show(this, "Scenario not created. Please create a scenario!", "View Selection");
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show(this, "Database not connected. Please connect to a database!", "View Selection");
            }


            if (panel == previewVCP)
            {
                if (previewVCP != null)
                {
                    previewVCP.ResumeScene();
                }
            }
        }