Example #1
0
        private WizardStepDesigner GetWizardStepDesigner(IComponent step)
        {
            IDesignerHost      service  = (IDesignerHost)this.GetService(typeof(IDesignerHost));
            WizardStepDesigner designer = null;

            if (service == null)
            {
                return(designer);
            }
            designer = (WizardStepDesigner)service.GetDesigner(step);
            return(designer);
        }
Example #2
0
 ///<summary>
 ///Called when a drag-and-drop operation leaves the control designer view.
 ///</summary>
 ///
 ///<param name="e">An <see cref="T:System.EventArgs"></see> that provides data for the event. </param>
 protected override void OnDragLeave(EventArgs e)
 {
     if (this.forwardOnDrag)
     {
         this.forwardOnDrag = false;
         WizardStepDesigner currentWizardStepDesigner = this.GetDesigner();
         if (currentWizardStepDesigner == null)
         {
             return;
         }
         currentWizardStepDesigner.OnDragLeaveInternal(e);
         return;
     }
     base.OnDragLeave(e);
 }
Example #3
0
 ///<summary>
 ///Receives a call when a drag-and-drop operation is in progress to provide visual cues based on the location of the mouse while a drag operation is in progress.
 ///</summary>
 ///
 ///<param name="e">A <see cref="T:System.Windows.Forms.GiveFeedbackEventArgs"></see> that provides data for the event. </param>
 protected override void OnGiveFeedback(GiveFeedbackEventArgs e)
 {
     if (this.forwardOnDrag)
     {
         WizardStepDesigner currentWizardStepDesigner = this.GetDesigner();
         if (currentWizardStepDesigner == null)
         {
             return;
         }
         currentWizardStepDesigner.OnGiveFeedbackInternal(e);
     }
     else
     {
         base.OnGiveFeedback(e);
     }
 }
Example #4
0
 ///<summary>
 ///Called when a drag-and-drop object is dropped onto the control designer view.
 ///</summary>
 ///
 ///<param name="de">A <see cref="T:System.Windows.Forms.DragEventArgs"></see> that provides data for the event. </param>
 protected override void OnDragDrop(DragEventArgs de)
 {
     if (this.forwardOnDrag)
     {
         this.forwardOnDrag = false;
         WizardStepDesigner currentWizardStepDesigner = this.GetDesigner();
         if (currentWizardStepDesigner != null)
         {
             currentWizardStepDesigner.OnDragDropInternal(de);
         }
     }
     else
     {
         de.Effect = DragDropEffects.None;
     }
 }
Example #5
0
        ///<summary>
        ///Called when a drag-and-drop object is dragged over the control designer view.
        ///</summary>
        ///
        ///<param name="de">A <see cref="T:System.Windows.Forms.DragEventArgs"></see> that provides data for the event. </param>
        protected override void OnDragOver(DragEventArgs de)
        {
            WizardControl control = this.Control as WizardControl;

            if (control == null || control.WizardSteps.Count <= 0)
            {
                de.Effect = DragDropEffects.None;
                return;
            }
            WizardStep         step = control.WizardSteps[control.CurrentStepIndex];
            Point              pt   = step.PointToClient(new Point(de.X, de.Y));
            WizardStepDesigner wizardStepDesigner = this.GetWizardStepDesigner(step);
            Rectangle          clientRectangle    = step.ClientRectangle;

            if (!clientRectangle.Contains(pt))
            {
                if (!this.forwardOnDrag)
                {
                    de.Effect = DragDropEffects.None;
                    return;
                }
                this.forwardOnDrag = false;
                wizardStepDesigner.OnDragLeaveInternal(EventArgs.Empty);
                base.OnDragEnter(de);
                return;
            }
            else
            {
                if (!this.forwardOnDrag)
                {
                    base.OnDragLeave(EventArgs.Empty);
                    wizardStepDesigner.OnDragEnterInternal(de);
                    this.forwardOnDrag = true;
                    return;
                }
                wizardStepDesigner.OnDragOverInternal(de);
                return;
            }
        }
Example #6
0
        private WizardStepDesigner GetDesigner()
        {
            WizardControl      control   = this.Control as WizardControl;
            WizardStep         component = null;
            IDesignerHost      service   = null;
            WizardStepDesigner designer  = null;

            if (control != null && control.WizardSteps.Count >= 0)
            {
                component = control.WizardSteps[control.CurrentStepIndex];
                service   = (IDesignerHost)this.GetService(typeof(IDesignerHost));
                designer  = null;
            }
            if (service == null)
            {
                return(designer);
            }
            if (component == null)
            {
                return(designer);
            }
            designer = (WizardStepDesigner)service.GetDesigner(component);
            return(designer);
        }