예제 #1
0
        /// <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>
        /// <param name="useMinimiseBox">Allow window to be minimised.</param>
        public KryptonDockingFloatingWindow(string name, Form owner, KryptonDockingFloatspace floatspace, bool useMinimiseBox)
            : base(name)
        {
            if (owner == null)
            {
                throw new ArgumentNullException(nameof(owner));
            }

            FloatspaceElement           = floatspace ?? throw new ArgumentNullException(nameof(floatspace));
            FloatspaceElement.Disposed += OnDockingFloatspaceDisposed;

            // Create the actual window control and hook into events
            FloatingWindow = new KryptonFloatingWindow(owner, floatspace.FloatspaceControl, useMinimiseBox);
            FloatingWindow.WindowCloseClicked    += OnFloatingWindowCloseClicked;
            FloatingWindow.WindowCaptionDragging += OnFloatingWindowCaptionDragging;
            FloatingWindow.Disposed += OnFloatingWindowDisposed;

            // Create and add a control we use to obscure the floating window client area during multi-part operations
            _obscure = new ObscureControl
            {
                Anchor  = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom),
                Visible = false
            };
            FloatingWindow.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)
 {
     FloatspaceControl = floatspace;
     FloatspaceElement = element;
     CellControl       = cell;
 }
예제 #3
0
        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 -= OnDockingFloatspaceDisposed;

            // Kill the floatspace window
            if (!FloatingWindow.IsDisposed)
            {
                FloatingWindow.Dispose();
            }
        }
예제 #4
0
 /// <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)
 {
     FloatspaceControl = floatspace;
     FloatspaceElement = element;
 }