/// <summary> /// Process the drag pages in the context of a target navigator. /// </summary> /// <param name="workspace">Target workspace instance.</param> /// <param name="target">Target workspace cell instance.</param> /// <param name="data">Dragged page data.</param> /// <returns>Last page to be transferred.</returns> protected KryptonPage ProcessDragEndData(KryptonWorkspace workspace, KryptonWorkspaceCell target, PageDragEndData data) { KryptonPage ret = null; // Add each source page to the target foreach (KryptonPage page in data.Pages) { // Only add the page if one of the allow flags is set if ((page.Flags & (int)AllowFlags) != 0) { // Use event to allow decision on if the page should be dropped // (or even swap the page for a different page to be dropped) PageDropEventArgs e = new PageDropEventArgs(page); workspace.OnPageDrop(e); if (!e.Cancel && (e.Page != null)) { target.Pages.Add(e.Page); ret = e.Page; } } } return(ret); }
/// <summary> /// Occurs when a page is dropped on the control. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">A PageDropEventArgs containing the event data.</param> protected override void RaiseSpacePageDrop(object sender, PageDropEventArgs e) { // Use event to indicate the page is moving to a workspace and allow it to be cancelled KryptonDockingManager dockingManager = DockingManager; if (dockingManager != null) { CancelUniqueNameEventArgs args = new CancelUniqueNameEventArgs(e.Page.UniqueName, false); dockingManager.RaisePageWorkspaceRequest(args); // Pass back the result of the event e.Cancel = args.Cancel; } }
private void OnDockableNavigatorPageDrop(object sender, PageDropEventArgs e) { // Use event to indicate the page is moving to a navigator and allow it to be cancelled KryptonDockingManager dockingManager = DockingManager; if (dockingManager != null) { CancelUniqueNameEventArgs args = new CancelUniqueNameEventArgs(e.Page.UniqueName, false); dockingManager.RaisePageNavigatorRequest(args); // Pass back the result of the event e.Cancel = args.Cancel; } }
/// <summary> /// Occurs when a page is dropped on the control. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">A PageDropEventArgs containing the event data.</param> protected abstract void RaiseSpacePageDrop(object sender, PageDropEventArgs e);