Exemple #1
0
        //private void control_TextChanged(object sender, EventArgs e)
        //{
        //}

        private void dockControl_Closing(object sender, CancelEventArgs e)
        {
            TD.SandDock.DockControl      dockControl = (TD.SandDock.DockControl)sender;
            System.Windows.Forms.Control control     = dockControl.Controls[0];
            if (control is bamboo.Controls.Editor.EditorControl)
            {
                bamboo.Controls.Editor.EditorControl editor = (bamboo.Controls.Editor.EditorControl)control;
                if (!editor.Close())
                {
                    e.Cancel = true;
                    return;
                }
            }
            else if (control is bamboo.Controls.ProjectExplorer.ProjectExplorerControl)
            {
                bamboo.Controls.ProjectExplorer.ProjectExplorerControl projectExplorer = (bamboo.Controls.ProjectExplorer.ProjectExplorerControl)control;
                if (!projectExplorer.Close())
                {
                    e.Cancel = true;
                    return;
                }
            }

            dockControl.Closing -= new CancelEventHandler(dockControl_Closing);
//			control.TextChanged -= new EventHandler(control_TextChanged);
        }
Exemple #2
0
        private void Application_Idle(object sender, EventArgs e)
        {
            foreach (System.Windows.Forms.ToolStripMenuItem menu in this.menuStrip.Items)
            {
                foreach (System.Windows.Forms.ToolStripItem menuItem in menu.DropDownItems)
                {
                    if (menuItem.Tag != null)
                    {
                        string command = (string)menuItem.Tag;
                        menuItem.Enabled = Water.Environment.IsConstant(command);
                    }
                }
            }
            foreach (System.Windows.Forms.ToolStripItem toolButton in this.toolStrip.Items)
            {
                if (toolButton.Tag != null)
                {
                    string command = (string)toolButton.Tag;
                    toolButton.Enabled = Water.Environment.IsConstant(command);
                }
            }



            string title = "";

            TD.SandDock.DockControl dockControl;
            bamboo.Controls.ProjectExplorer.ProjectExplorerControl projectExplorer = null;
            bamboo.Controls.Editor.EditorControl editorControl = null;

            dockControl = FindWindow("View.ProjectExplorer");
            if (dockControl != null)
            {
                projectExplorer = (bamboo.Controls.ProjectExplorer.ProjectExplorerControl)dockControl.Controls[0];
                if (projectExplorer.ProjectName != null && projectExplorer.ProjectName != "")
                {
                    title += projectExplorer.ProjectName;
                }
            }

            dockControl = this.ActiveDocument;
            if (dockControl != null && dockControl.Controls[0] is bamboo.Controls.Editor.EditorControl)
            {
                editorControl = (bamboo.Controls.Editor.EditorControl)dockControl.Controls[0];
                if (title.Length > 0)
                {
                    title += ", ";
                }
                title += editorControl.Text;
            }

            string text = "Bamboo";

            if (title.Length > 0)
            {
                text += " - " + title;
            }

            if (this.Text != text)
            {
                this.Text = text;
            }
        }