/// <summary> /// Initialize a new instance of the KryptonDockingFloatingWindow class. /// </summary> /// <param name="name">Initial name of the element.</param> /// <param name="owner">Reference to form that owns the floating windows.</param> /// <param name="floatspace">Reference to form that will own all the floating window.</param> public KryptonDockingFloatingWindow(string name, Form owner, KryptonDockingFloatspace floatspace) : base(name) { if (owner == null) { throw new ArgumentNullException("owner"); } if (floatspace == null) { throw new ArgumentNullException("floatspace"); } _floatspace = floatspace; _floatspace.Disposed += new EventHandler(OnDockingFloatspaceDisposed); // Create the actual window control and hook into events _window = new KryptonFloatingWindow(owner, floatspace.FloatspaceControl); _window.WindowCloseClicked += new EventHandler <UniqueNamesEventArgs>(OnFloatingWindowCloseClicked); _window.WindowCaptionDragging += new EventHandler <ScreenAndOffsetEventArgs>(OnFloatingWindowCaptionDragging); _window.Disposed += new EventHandler(OnFloatingWindowDisposed); // Create and add a control we use to obscure the floating window client area during multi-part operations _obscure = new ObscureControl(); _obscure.Anchor = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom); _obscure.Visible = false; _window.Controls.Add(_obscure); // Add the floatspace as the only child of this collection InternalAdd(floatspace); }
/// <summary> /// Initialize a new instance of the FloatspaceCellEventArgs class. /// </summary> /// <param name="floatspace">Reference to existing floatspace control instance.</param> /// <param name="element">Reference to docking floatspace element that is managing the floatspace control.</param> /// <param name="cell">Reference tofloatspace control cell instance.</param> public FloatspaceCellEventArgs(KryptonFloatspace floatspace, KryptonDockingFloatspace element, KryptonWorkspaceCell cell) { _floatspace = floatspace; _element = element; _cell = cell; }
private void OnDockingFloatspaceDisposed(object sender, EventArgs e) { // Cast to correct type and unhook event handlers so garbage collection can occur KryptonDockingFloatspace floatspaceElement = (KryptonDockingFloatspace)sender; floatspaceElement.Disposed -= new EventHandler(OnDockingFloatspaceDisposed); // Kill the floatspace window if (!FloatingWindow.IsDisposed) { FloatingWindow.Dispose(); } }
private KryptonDockingFloatingWindow CreateFloatingWindow(string name) { // Create a floatspace and floating window for hosting the floatspace KryptonDockingFloatspace floatSpaceElement = new KryptonDockingFloatspace("Floatspace"); KryptonDockingFloatingWindow floatingWindowElement = new KryptonDockingFloatingWindow(name, OwnerForm, floatSpaceElement); floatingWindowElement.Disposed += new EventHandler(OnDockingFloatingWindowDisposed); InternalAdd(floatingWindowElement); // Events are generated from the parent docking manager KryptonDockingManager dockingManager = DockingManager; if (dockingManager != null) { // Generate events so the floating window/dockspace appearance can be customized FloatingWindowEventArgs floatingWindowArgs = new FloatingWindowEventArgs(floatingWindowElement.FloatingWindow, floatingWindowElement); FloatspaceEventArgs floatSpaceArgs = new FloatspaceEventArgs(floatSpaceElement.FloatspaceControl, floatSpaceElement); dockingManager.RaiseFloatingWindowAdding(floatingWindowArgs); dockingManager.RaiseFloatspaceAdding(floatSpaceArgs); } return(floatingWindowElement); }
/// <summary> /// Initialize a new instance of the FloatspaceEventArgs class. /// </summary> /// <param name="floatspace">Reference to new floatspace control instance.</param> /// <param name="element">Reference to docking floatspace element that is managing the floatspace control.</param> public FloatspaceEventArgs(KryptonFloatspace floatspace, KryptonDockingFloatspace element) { _floatspace = floatspace; _element = element; }