ComponentFactory.Krypton.Docking.KryptonDockingSpace.OnSpaceCellPageInserting C# (CSharp) Method

OnSpaceCellPageInserting() protected method

Occurs when a page is added to a cell in the workspace.
protected OnSpaceCellPageInserting ( object sender, KryptonPageEventArgs e ) : void
sender object Source of the event.
e KryptonPageEventArgs A KryptonPageEventArgs containing the event data.
return void
        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;
            }
        }