public DockToolStripMenuItem(EcellDockContent content)
 {
     this.Name = content.Name;
     this.Image = (Image)TypeDescriptor.GetConverter(content.Icon)
             .ConvertTo(content.Icon, typeof(Image));
     this.Text = content.Text;
     this.Checked = !content.IsHidden;
     this.Click += new EventHandler(DockContentMenu_Click);
     m_content = content;
     m_content.DockStateChanged += new EventHandler(DockContent_DockStateChanged);
 }
        public void TestConstructor()
        {
            EcellDockContent content = new EcellDockContent();
            Assert.IsNotNull(content, "Constructor of type, EcellDockContent failed to create instance.");
            Assert.AreEqual("Ecell.Plugin.EcellDockContent", content.GetType().ToString(), "Type is unexpected value.");
            Assert.AreEqual(true, content.HideOnClose, "HideOnClose is unexpected value.");
            Assert.AreEqual(DockContentType.NONE, content.ContentType, "ContentType is unexpected value.");

            content.HideOnClose = true;
            Assert.AreEqual(true, content.HideOnClose, "HideOnClose is unexpected value.");

            Form form = null;
            try
            {
                form = new Form();
                DockPanel panel = new DockPanel();
                panel.DocumentStyle = DocumentStyle.DockingWindow;
                form.SuspendLayout();
                form.Controls.Add(panel);
                form.SuspendLayout();
                form.Show();

                //Create New DockContent
                content.Pane = null;
                content.PanelPane = null;
                content.FloatPane = null;
                content.DockHandler.DockPanel = panel;
                content.IsHidden = false;
                content.Show();
                content.GetDesktopLocation();
                content.FloatAt(new Rectangle(100, 100, 500, 500));
                content.GetDesktopLocation();
                content.Hide();
                content.ContentType = DockContentType.NONE;
            }
            catch (Exception)
            {
                Assert.Fail("Fail to create new DockContent");
            }
            finally
            {
                if (form != null)
                    form.Close();
            }
        }
Exemple #3
0
        /// <summary>
        /// set DockContent
        /// </summary>
        private void SetDockContent(EcellDockContent content)
        {
            m_env.LogManager.Append(new ApplicationLogEntry(
                MessageType.Information,
                string.Format(MessageResources.DockPreparing, content.Text),
                this
            ));
            content.SuspendLayout();
            //Create New DockContent
            content.Pane = null;
            content.PanelPane = null;
            content.FloatPane = null;
            content.DockHandler.DockPanel = this.dockPanel;
            content.IsHidden = false;
            if (content.ContentType == DockContentType.GRAPH)
            {
                content.FormClosing += new FormClosingEventHandler(this.Graph_Closing);
            }
            else
            {
                content.FormClosing += new FormClosingEventHandler(this.DockContent_Closing);
            }

            //Create DockWindow Menu
            DockToolStripMenuItem item = new DockToolStripMenuItem(content);
            if (content.ContentType == DockContentType.NONE)
            {
                this.showWindowToolStripMenuItem.DropDown.Items.Add(item);
            }
            else if (content.ContentType == DockContentType.ANALYSIS)
            {
                this.analysisGroupToolStripMenuItem.DropDown.Items.Add(item);
            }
            else if (content.ContentType == DockContentType.GRAPH)
            {
                this.graphGroupToolStripMenuItem.DropDown.Items.Add(item);
            }

            m_dockWindowDic.Add(content.Name, content);
            content.ResumeLayout();
            content.Show(this.dockPanel, DockState.Document);
        }
Exemple #4
0
 /// <summary>
 /// Get the window form for ObjectList.
 /// </summary>
 /// <returns>UserControl</returns>        
 public override IEnumerable<EcellDockContent> GetWindowsForms()
 {
     EcellDockContent win = new EcellDockContent();
     m_control.Dock = DockStyle.Fill;
     win.Controls.Add(m_control);
     win.Name = "EntityList";
     win.Text = MessageResources.EntityList;
     win.Icon = Resources.EntityList;
     win.TabText = win.Text;
     return new EcellDockContent[] { win };
 }
 public void TearDown()
 {
     _unitUnderTest = null;
 }
 public void SetUp()
 {
     _unitUnderTest = new EcellDockContent();
 }
        /// <summary>
        /// Get the pain to show the analysis result.
        /// </summary>
        /// <returns>the list of analysis result window.</returns>
        public IEnumerable<EcellDockContent> GetWindowsForms()
        {
            m_graphContent = new EcellDockContent();
            m_graphResultWindow.Dock = DockStyle.Fill;
            m_graphContent.Controls.Add(m_graphResultWindow);
            m_graphContent.Name = "GraphResullt";
            m_graphContent.Text = MessageResources.GraphResult;
            m_graphContent.Icon = Resources.GraphResult;
            m_graphContent.TabText = m_graphContent.Text;
            m_graphContent.ContentType = DockContentType.ANALYSIS;

            m_sensContent = new EcellDockContent();
            m_sensResultWindow.Dock = DockStyle.Fill;
            m_sensContent.Controls.Add(m_sensResultWindow);
            m_sensContent.Name = "SensitivityResullt";
            m_sensContent.Text = MessageResources.SensitivityResult;
            m_sensContent.Icon = Resources.SensitivityResult;
            m_sensContent.TabText = m_sensContent.Text;
            m_sensContent.ContentType = DockContentType.ANALYSIS;

            m_paramContent = new EcellDockContent();
            m_paramResultWindow.Dock = DockStyle.Fill;
            m_paramContent.Controls.Add(m_paramResultWindow);
            m_paramContent.Name = "ParameterEstimationResullt";
            m_paramContent.Text = MessageResources.ParameterEstimationResult;
            m_paramContent.Icon = Resources.ParameterEstimationResult;
            m_paramContent.TabText = m_paramContent.Text;
            m_paramContent.ContentType = DockContentType.ANALYSIS;

            return new EcellDockContent[] { m_graphContent, m_sensContent, m_paramContent };
        }