Beispiel #1
0
        private void Reset()
        {
            RedockService redockService = this.radDock1.GetService <RedockService>();

            foreach (ToolWindow toolWindow in this.radDock1.DockWindows.ToolWindows)
            {
                toolWindow.DockState = DockState.Docked;
                redockService.ClearState(toolWindow, DockState.Floating);
            }
        }
Beispiel #2
0
        protected override IEnumerable GetCollectionElementOverride(IEnumerable list, object owner, System.ComponentModel.PropertyDescriptor property)
        {
            RadDock dock = (RadDock)this.RootSerializationObject;

            RedockService service = dock.GetService <RedockService>(ServiceConstants.Redock);

            if (service == null)
            {
                return(base.GetCollectionElementOverride(list, owner, property));
            }

            DockTabStrip tabStrip = owner as DockTabStrip;

            if (tabStrip == null)
            {
                return(base.GetCollectionElementOverride(list, owner, property));
            }

            if (property == null || property.Name != "Controls")
            {
                return(base.GetCollectionElementOverride(list, owner, property));
            }

            DockTabStrip.ControlCollection controls = list as DockTabStrip.ControlCollection;

            if (controls == null)
            {
                return(base.GetCollectionElementOverride(list, owner, property));
            }

            //Serialize FloatingWindows, in the same container as they where originally according to their redock state.
            //Later upon deserialization, floating windows state will be restored according to layout of (placehoder) windows
            //stored in SerializableFloatingWindows collection

            ArrayList res = new ArrayList(controls);

            foreach (DockWindow dockWindow in dock.DockWindows.GetWindows(delegate(DockWindow window)
            {
                return(window.DockState == DockState.Floating ||
                       window.DockState == DockState.AutoHide ||
                       window.DockState == DockState.Hidden);
            }))
            {
                RedockState state = service.GetState(dockWindow, DockState.Docked, false);
                if (state != null)
                {
                    if (state.TargetStrip == tabStrip)
                    {
                        res.Add(dockWindow);
                    }
                }
                else if (this.serializeDockWindowsWithoutRedockState)
                {
                    if (this.firstDockedTabStrip == tabStrip)
                    {
                        res.Add(dockWindow);
                    }
                }
            }
            if (this.firstDockedTabStrip == tabStrip)
            {
                this.serializeDockWindowsWithoutRedockState = false;
            }

            return(res);
        }
Beispiel #3
0
            /// <summary>
            /// RadMenu Actions for RadDock Control
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void DockMenu_Click(object sender, EventArgs e)
            {
                _AHK ahk = new _AHK();

                RadMenuItem clicked = (RadMenuItem)sender; string txt = clicked.Text;

                if (txt == "Add Form")
                {
                    DockAddForm(raddock, "TreePrompt", DockPosition.Right);
                }
                if (txt == "Restore States")
                {
                    RedockService service = raddock.GetService <RedockService>();
                    foreach (DockWindow window in raddock.DockWindows)
                    {
                        if (window.DockState == DockState.Floating)
                        {
                            service.RestoreState(window, DockState.Docked, true);
                        }
                    }
                }
                if (txt == "Active Document")
                {
                    DockWindow activeDocument = raddock.DocumentManager.ActiveDocument;
                    string     name           = "";
                    try { name = activeDocument.Name; }
                    catch { }

                    ahk.MsgBox("Active Document Name: " + name);
                }
                if (txt == "Active Window")
                {
                    DockWindow activeWindow = raddock.ActiveWindow;
                    ahk.MsgBox("Active Window Name: " + activeWindow.Name);
                }

                try
                {
                    if (txt == "Document Bold On")
                    {
                        raddock.DocumentManager.BoldActiveDocument = true;
                    }
                    if (txt == "Document Bold Off")
                    {
                        raddock.DocumentManager.BoldActiveDocument = false;
                    }
                    if (txt == "Document Insert Order Front")
                    {
                        raddock.DocumentManager.DocumentInsertOrder = DockWindowInsertOrder.InFront;
                    }
                    if (txt == "Document Insert Order Back")
                    {
                        raddock.DocumentManager.DocumentInsertOrder = DockWindowInsertOrder.ToBack;
                    }
                    if (txt == "Dock Template VS 2008")
                    {
                        raddock.DockingGuidesTemplate = PredefinedDockingGuidesTemplate.VS2008;
                    }
                    if (txt == "Dock Template VS 2010")
                    {
                        raddock.DockingGuidesTemplate = PredefinedDockingGuidesTemplate.VS2010;
                    }
                    if (txt == "Dock Template Office 2010")
                    {
                        raddock.DockingGuidesTemplate = PredefinedDockingGuidesTemplate.Office2010;
                    }
                    if (txt == "Dock Template Default")
                    {
                        raddock.DockingGuidesTemplate = PredefinedDockingGuidesTemplate.ControlDefault;
                    }
                    if (txt == "Dock Template Custom")
                    {
                        NewDockingGuideTemplate();
                    }
                    if (txt == "Enable DragDrop Services")
                    {
                        InitDragDropEvents();
                    }
                    if (txt == "Enable Dock Manager Edges")
                    {
                        InitDragDropProperties();
                    }
                    if (txt == "Enable Dock Shortcuts")
                    {
                        EnableDockShortcuts();
                    }
                    if (txt == "Register Dock Custom Command")
                    {
                        RegisterCustomCommand();
                    }
                    if (txt == "Toggle Command Manager")
                    {
                        ToggleCommandManager();
                    }
                    if (txt == "Configure Context Menu")
                    {
                        ConfigureContextMenu();
                    }
                    if (txt == "Toggle SingleScreen FloadMode")
                    {
                        ToggleSingleScreenFloatMode();
                    }
                    if (txt == "Toggle Window Snapping Mode")
                    {
                        ToggleWindowSnapping();
                    }
                    if (txt == "Close All Windows")
                    {
                        CloseAllWindows();
                    }
                    if (txt == "New Tool Window")
                    {
                        NewToolWindow();
                    }
                }
                catch
                {
                    //bool launched = CommandLaunch(ToSharpLaunch(txt));

                    //LaunchForm ln = new LaunchForm();
                    //bool launched = ln.Launch(txt, false, "", CurrentForm);

                    string error = "";
                }

                //if (txt == "") { }
                //if (txt == "") { }
                //if (txt == "") { }
                //if (txt == "") { }
                //if (txt == "") { }
                //if (txt == "") { }
                //if (txt == "") { }

                sb("Clicked " + txt);
            }