/// <summary> /// Occurs when a page is added to a cell in the workspace. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">A KryptonPageEventArgs containing the event data.</param> protected virtual void OnSpaceCellPageInserting(object sender, KryptonPageEventArgs e) { KryptonDockingManager dockingManager = DockingManager; if (dockingManager != null) { if (e.Item is KryptonStorePage) { KryptonDockspace dockspace = sender as KryptonDockspace; if ((dockspace != null) && (dockspace.CellForPage(e.Item) != null)) { // Prevent this existing store page from being removed due to the Propogate action below. This can // occur because a cell with pages is added in one go and so insert events are generated for the // existing pages inside the cell to ensure that the event is always fired consistently. IgnoreStorePage = (KryptonStorePage)e.Item; } KryptonDockableWorkspace workspace = sender as KryptonDockableWorkspace; if ((workspace != null) && (workspace.CellForPage(e.Item) != null)) { // Prevent this existing store page from being removed due to the Propogate action below. This can // occur because a cell with pages is added in one go and so insert events are generated for the // existing pages inside the cell to ensure that the event is always fired consistently. IgnoreStorePage = (KryptonStorePage)e.Item; } } // Remove any store page for the unique name of this page being added. dockingManager.PropogateAction(ClearStoreAction, new string[] { e.Item.UniqueName }); IgnoreStorePage = null; } }
/// <summary> /// Initialize a new instance of the DockableWorkspaceCellEventArgs class. /// </summary> /// <param name="workspace">Reference to existing dockable workspace control instance.</param> /// <param name="element">Reference to docking workspace element that is managing the dockable workspace control.</param> /// <param name="cell">Reference to workspace control cell instance.</param> public DockableWorkspaceCellEventArgs(KryptonDockableWorkspace workspace, KryptonDockingWorkspace element, KryptonWorkspaceCell cell) { DockableWorkspaceControl = workspace; WorkspaceElement = element; CellControl = cell; }
/// <summary> /// Initialize a new instance of the DockableWorkspaceCellEventArgs class. /// </summary> /// <param name="workspace">Reference to existing dockable workspace control instance.</param> /// <param name="element">Reference to docking workspace element that is managing the dockable workspace control.</param> /// <param name="cell">Reference to workspace control cell instance.</param> public DockableWorkspaceCellEventArgs(KryptonDockableWorkspace workspace, KryptonDockingWorkspace element, KryptonWorkspaceCell cell) { _workspace = workspace; _element = element; _cell = cell; }
/// <summary> /// Initialize a new instance of the KryptonDockingWorkspace class. /// </summary> /// <param name="name">Initial name of the element.</param> /// <param name="storeName">Name to use for storage pages.</param> /// <param name="workspace">Reference to workspace to manage.</param> public KryptonDockingWorkspace(string name, string storeName, KryptonDockableWorkspace workspace) : base(name, storeName) { SpaceControl = workspace ?? throw new ArgumentNullException(nameof(workspace)); DockableWorkspaceControl.CellPageInserting += OnSpaceCellPageInserting; DockableWorkspaceControl.BeforePageDrag += OnDockableWorkspaceBeforePageDrag; }
/// <summary> /// Initialize a new instance of the KryptonDockingWorkspace class. /// </summary> /// <param name="name">Initial name of the element.</param> /// <param name="storeName">Name to use for storage pages.</param> /// <param name="workspace">Reference to workspace to manage.</param> public KryptonDockingWorkspace(string name, string storeName, KryptonDockableWorkspace workspace) : base(name, storeName) { SpaceControl = workspace ?? throw new ArgumentNullException("workspace"); DockableWorkspaceControl.CellPageInserting += new EventHandler <KryptonPageEventArgs>(OnSpaceCellPageInserting); DockableWorkspaceControl.BeforePageDrag += new EventHandler <PageDragCancelEventArgs>(OnDockableWorkspaceBeforePageDrag); }
/// <summary> /// Initialize a new instance of the KryptonDockingWorkspace class. /// </summary> /// <param name="name">Initial name of the element.</param> /// <param name="storeName">Name to use for storage pages.</param> /// <param name="workspace">Reference to workspace to manage.</param> public KryptonDockingWorkspace(string name, string storeName, KryptonDockableWorkspace workspace) : base(name, storeName) { if (workspace == null) throw new ArgumentNullException("workspace"); SpaceControl = workspace; DockableWorkspaceControl.CellPageInserting += new EventHandler<KryptonPageEventArgs>(OnSpaceCellPageInserting); DockableWorkspaceControl.BeforePageDrag += new EventHandler<PageDragCancelEventArgs>(OnDockableWorkspaceBeforePageDrag); }
/// <summary> /// Initialize a new instance of the DockableWorkspaceEventArgs class. /// </summary> /// <param name="workspace">Reference to dockable workspace control instance.</param> /// <param name="element">Reference to docking workspace element that is managing the dockable workspace control.</param> public DockableWorkspaceEventArgs(KryptonDockableWorkspace workspace, KryptonDockingWorkspace element) { _workspace = workspace; _element = element; }
/// <summary> /// Initialize a new instance of the DockableWorkspaceEventArgs class. /// </summary> /// <param name="workspace">Reference to dockable workspace control instance.</param> /// <param name="element">Reference to docking workspace element that is managing the dockable workspace control.</param> public DockableWorkspaceEventArgs(KryptonDockableWorkspace workspace, KryptonDockingWorkspace element) { DockableWorkspaceControl = workspace; DockingWorkspaceElement = element; }
/// <summary> /// Manage docking capability for provided dockable workspace control. /// </summary> /// <param name="name">Name for new docking element.</param> /// <param name="storeName">Store name for docking element.</param> /// <param name="w">Reference to dockable workspace.</param> /// <returns>KryptonDockingWorkspace instance created.</returns> public KryptonDockingWorkspace ManageWorkspace(string name, string storeName, KryptonDockableWorkspace w) { KryptonDockingWorkspace dockingWorkspace = new KryptonDockingWorkspace(name, storeName, w); Add(dockingWorkspace); return dockingWorkspace; }
/// <summary> /// Manage docking capability for provided dockable workspace control. /// </summary> /// <param name="name">Name for new docking element.</param> /// <param name="w">Reference to dockable workspace.</param> /// <returns>KryptonDockingWorkspace instance created.</returns> public KryptonDockingWorkspace ManageWorkspace(string name, KryptonDockableWorkspace w) { return ManageWorkspace(name, "Filler", w); }
/// <summary> /// Manage docking capability for provided dockable workspace control. /// </summary> /// <param name="w">Reference to dockable workspace.</param> /// <returns>KryptonDockingWorkspace instance created.</returns> public KryptonDockingWorkspace ManageWorkspace(KryptonDockableWorkspace w) { return ManageWorkspace("Workspace", "Filler", w); }