Example #1
0
        protected internal virtual void RemoveStep()
        {
            IDesignerHost service = (IDesignerHost)GetService(typeof(IDesignerHost));

            if (WizardControl == null || service == null)
            {
                return;
            }
            if (MessageBox.Show(WizardControl.FindForm(), "Are you sure you want to remove the step?", "Remove Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                WizardStep step = WizardControl.WizardSteps[WizardControl.CurrentStepIndex];
                WizardControl.WizardSteps.Remove(step);
                service.DestroyComponent(step);
                step.Dispose();
            }
            SelectWizard();
        }
Example #2
0
        ///<summary>
        ///Called when a drag-and-drop operation enters 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 OnDragEnter(DragEventArgs de)
        {
            WizardControl control = (WizardControl)Control;

            if (control.WizardSteps.Count <= 0)
            {
                base.OnDragEnter(de);
                return;
            }
            WizardStep step            = control.WizardSteps[control.CurrentStepIndex];
            Point      pt              = step.PointToClient(new Point(de.X, de.Y));
            Rectangle  clientRectangle = step.ClientRectangle;

            if (!clientRectangle.Contains(pt))
            {
                base.OnDragEnter(de);
                return;
            }
            GetWizardStepDesigner(step).OnDragEnterInternal(de);
            forwardOnDrag = true;
        }
Example #3
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 = 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 = GetWizardStepDesigner(step);
            Rectangle          clientRectangle    = step.ClientRectangle;

            if (!clientRectangle.Contains(pt))
            {
                if (!forwardOnDrag)
                {
                    de.Effect = DragDropEffects.None;
                    return;
                }
                forwardOnDrag = false;
                wizardStepDesigner.OnDragLeaveInternal(EventArgs.Empty);
                base.OnDragEnter(de);
                return;
            }
            else
            {
                if (!forwardOnDrag)
                {
                    base.OnDragLeave(EventArgs.Empty);
                    wizardStepDesigner.OnDragEnterInternal(de);
                    forwardOnDrag = true;
                    return;
                }
                wizardStepDesigner.OnDragOverInternal(de);
                return;
            }
        }
Example #4
0
        private WizardStepDesigner GetDesigner()
        {
            WizardControl      control   = 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)GetService(typeof(IDesignerHost));
                designer  = null;
            }
            if (service == null)
            {
                return(designer);
            }
            if (component == null)
            {
                return(designer);
            }
            designer = (WizardStepDesigner)service.GetDesigner(component);
            return(designer);
        }
Example #5
0
        protected internal virtual void RemoveAllSteps()
        {
            IDesignerHost service = (IDesignerHost)GetService(typeof(IDesignerHost));

            if (WizardControl == null || service == null)
            {
                return;
            }
            if (MessageBox.Show(WizardControl.FindForm(), "Are you sure you want to remove all the steps?", "Remove Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }
            WizardStep[] array = new WizardStep[WizardControl.WizardSteps.Count];
            ((ICollection)WizardControl.WizardSteps).CopyTo(array, 0);
            WizardControl.WizardSteps.Clear();
            WizardStep[] stepArray2 = array;
            for (int index = 0; index < stepArray2.Length; index++)
            {
                WizardStep component = stepArray2[index];
                service.DestroyComponent(component);
                index++;
            }
            SelectWizard();
        }
Example #6
0
 protected virtual void ResetAppearence()
 {
     WizardStep.Reset();
     WizardStep.Invalidate();
 }
Example #7
0
 public override void Initialize(IComponent component)
 {
     wizardStep = (WizardStep)component;
     base.Initialize(component);
 }