Example #1
0
        public void DoDock(bool bShowFixedPanel)
        {
            // return; // 测试内存泄漏

            if (Program.MainForm.CurrentPropertyControl != this.tabControl_main)
            {
                Program.MainForm.CurrentPropertyControl = this.tabControl_main;
            }

            // 防止内存泄漏
            ControlExtention.AddFreeControl(_freeControls, this.tabControl_main);

            if (bShowFixedPanel == true &&
                Program.MainForm.PanelFixedVisible == false)
            {
                Program.MainForm.PanelFixedVisible = true;

                // 把 propertypage 翻出来
                Program.MainForm.ActivatePropertyPage();
            }

            this.Docked  = true;
            this.Visible = false;

            if (this.MyDockChanged != null)
            {
                this.MyDockChanged(this, new EventArgs());
            }
        }
Example #2
0
        void VisibleEditArea(bool bVisible)
        {
            this.checkBox_displayEditArea.Checked = bVisible;

            if (m_bEditAreaVisible == bVisible)
            {
                return;
            }

            if (bVisible == false)
            {
                // 隐藏编辑区域。相当于把装订控件直接放到顶层

                // 从集合中移出装订控件
                this.splitContainer_main.Panel2.Controls.Remove(this.bindingControl1);

                // 修改装订控件的位置和尺寸
                this.bindingControl1.Dock     = DockStyle.None;
                this.bindingControl1.Anchor   = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
                this.bindingControl1.Location = this.splitContainer_main.Location;
                this.bindingControl1.Size     = this.splitContainer_main.Size;
                if (this.Controls.IndexOf(this.bindingControl1) == -1)
                {
                    this.Controls.Add(this.bindingControl1);
                }

                this.Controls.Remove(this.splitContainer_main);
                ControlExtention.AddFreeControl(_freeControls, this.splitContainer_main);
            }
            else
            {
                // 显示编辑区域。相当于把分割控件直接放到顶层
                this.splitContainer_main.Dock     = DockStyle.None;
                this.splitContainer_main.Anchor   = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
                this.splitContainer_main.Location = this.bindingControl1.Location;
                this.splitContainer_main.Size     = this.bindingControl1.Size;

                this.Controls.Remove(this.bindingControl1);
                this.bindingControl1.Dock = DockStyle.Fill;
                this.splitContainer_main.Panel1.Controls.Add(this.bindingControl1);

                this.Controls.Add(this.splitContainer_main);
                ControlExtention.RemoveFreeControl(_freeControls, this.splitContainer_main);
            }

            this.m_bEditAreaVisible = bVisible;
        }
Example #3
0
        void HidePages()
        {
            if (StringUtil.IsInList("all", this.DisplayStyle) == true)
            {
                return;
            }

            for (int i = 0; i < this.tabControl_main.TabPages.Count; i++)
            {
                TabPage page        = this.tabControl_main.TabPages[i];
                string  strPageName = page.Tag as string;
                if (StringUtil.IsInList(strPageName, this.DisplayStyle) == false)
                {
                    this.tabControl_main.TabPages.Remove(page);
                    ControlExtention.AddFreeControl(_freeControls, page);
                    i--;
                }
            }
        }
Example #4
0
        /// <summary>
        /// 进行停靠
        /// </summary>
        /// <param name="bShowFixedPanel">是否同时促成显示固定面板</param>
        public void DoDock(bool bShowFixedPanel)
        {
            // return; // 测试内存泄漏
            if (this.MainForm.CurrentPropertyControl != this.tabControl_main)
            {
                this.MainForm.CurrentPropertyControl = this.tabControl_main;
                // 防止内存泄漏
                ControlExtention.AddFreeControl(_freeControls, this.tabControl_main);
            }

            if (bShowFixedPanel == true &&
                this.MainForm.PanelFixedVisible == false)
            {
                this.MainForm.PanelFixedVisible = true;
            }

            this.Docked  = true;
            this.Visible = false;
        }
Example #5
0
        void HideHtmlControls(bool bHide)
        {
            if (bHide == true)
            {
                this.tabControl1.TabPages.Remove(this.tabPage_html);
                ControlExtention.AddFreeControl(_freeControls, this.tabPage_html);  // 2015/11/7

                this.tabPage_text.Text = "纯文本";
            }
            else
            {
                this.tabControl1.TabPages.Add(this.tabPage_html);
                ControlExtention.RemoveFreeControl(_freeControls, this.tabPage_html);

                this.tabControl1.SelectTab(this.tabPage_html);

                this.tabPage_text.Text = "HTML代码";
                this.tabPage_html.Text = "打印效果";
            }
        }
Example #6
0
        private void OracleDataSourceWizard_Load(object sender, EventArgs e)
        {
            this._originTitle = this.Text;

            SetTitle();
            SetButtonState();

            if (string.IsNullOrEmpty(this.textBox_sqlServerName.Text) == true)
            {
                BuildServerName();
                this.textBox_sqlServerName.ReadOnly = true;
            }
            else
            {
                this._createMode = false;   // 修改模式。不使用模板构造 sql server name
                this.textBox_sqlServerName.ReadOnly = false;

                this.textBox_port.Enabled        = false;
                this.textBox_hostName.Enabled    = false;
                this.textBox_serviceName.Enabled = false;
                this.tabControl_serverName.TabPages.Remove(this.tabPage_template);
                ControlExtention.AddFreeControl(_freeControls, this.tabPage_template);  // 2015/11/7
            }
        }
Example #7
0
 public void AddFreeControl(Control control)
 {
     ControlExtention.AddFreeControl(_freeControls, control);
 }