private void captionSystemDownButton_MouseDown(object sender, MouseEventArgs e) { DockWindow activeWindow = this.ActiveWindow; if (activeWindow == null) { return; } RadDock dock = this.DockManager; if (dock == null) { return; } ContextMenuService service = dock.GetService <ContextMenuService>(ServiceConstants.ContextMenu); if (service != null) { service.DisplayContextMenu(activeWindow, Control.MousePosition); } }
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); }