Example #1
0
        private void OnActiveDocumentMenuItemClick(object sender, EventArgs e)
        {
            RadMenuItem item = sender as RadMenuItem;

            if (item == null)
            {
                return;
            }

            DockWindow window = item.Tag as DockWindow;

            if (window != null)
            {
                window.EnsureVisible();
            }
        }
Example #2
0
        /// <summary>
        /// Performs the core action, depending on the clicked menu item.
        /// </summary>
        /// <param name="menuItem"></param>
        /// <param name="window"></param>
        protected virtual void PerformMenuItemAction(DockWindow window, RadMenuItemBase menuItem)
        {
            switch (menuItem.Name)
            {
            case ActivateWindow:
                this.DockManager.ActiveWindow = window;
                window.EnsureVisible();
                break;

            case DockStateAutoHide:
            case DockStateDocked:
            case DockStateFloating:
            case DockStateHidden:
            case DockStateTabbedDocument:
                this.DockManager.SetWindowState(window, (DockState)Enum.Parse(typeof(DockState), menuItem.Name));
                break;

            case CloseAll:
                this.CloseAllDocuments(null);
                break;

            case CloseAllButThis:
                this.CloseAllDocuments(window);
                break;

            case CloseWindow:
                window.Close();
                break;

            case NewHTabGroup:
                this.DockManager.AddDocument(window, window.TabStrip as DocumentTabStrip, DockPosition.Bottom);
                break;

            case NewVTabGroup:
                this.DockManager.AddDocument(window, window.TabStrip as DocumentTabStrip, DockPosition.Right);
                break;

            case MoveToPrevTabGroup:
                this.DockManager.MoveToPreviousDocumentTabStrip(window);
                break;

            case MoveToNextTabGroup:
                this.DockManager.MoveToNextDocumentTabStrip(window);
                break;
            }
        }