internal static void SetStyle(WizardStep step) { step.BackgroundImageLayout = ImageLayout.Stretch; step.ApplingTheme = true; Image[] imageArray = CollectImages(); if ((step is StartStep)) { StartStep startStep = (StartStep) step; startStep.BindingImage = imageArray[0]; startStep.Icon = imageArray[3]; } if ((step is IntermediateStep)) { IntermediateStep intermediateStep = (IntermediateStep) step; intermediateStep.ForeColor = Color.FromName("Black"); intermediateStep.BindingImage = imageArray[2]; intermediateStep.Icon = imageArray[3]; } if ((step is FinishStep)) { FinishStep finishStep = (FinishStep) step; finishStep.BackgroundImage = imageArray[1]; } step.ApplingTheme = false; }
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(); }
///<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; }
///<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; } }
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(); }
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); }
public override void Initialize(IComponent component) { wizardStep = (WizardStep)component; base.Initialize(component); }
protected virtual void ResetAppearence() { WizardStep.Reset(); WizardStep.Invalidate(); }
protected internal virtual void RemoveAllSteps() { WizardControl wizardControl = WizardControl; if (wizardControl == 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; } IDesignerHost service = (IDesignerHost) GetService(typeof (IDesignerHost)); if (service == null) { return; } WizardStep[] array = new WizardStep[wizardControl.WizardSteps.Count]; 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(); }
public override void Initialize(IComponent component) { wizardStep = (WizardStep) component; base.Initialize(component); }
private WizardStepDesigner GetWizardStepDesigner(WizardStep step) { IDesignerHost service = (IDesignerHost) GetService(typeof (IDesignerHost)); WizardStepDesigner designer = null; if (service == null) { return designer; } designer = (WizardStepDesigner) service.GetDesigner(step); return designer; }
void wizardStepCollection_Removed(int index, WizardStep value) { value.Dispose(); if (this.wizardStepCollection.Count != 1) { this.UpdateButtons(); } else { this.OnSetFirstStep(); } }
private void wizardStepCollection_Inserted(int index, WizardStep value) { if (this.wizardStepCollection.Count != 1) { this.UpdateButtons(); } else { this.OnSetFirstStep(); } }
private void RefreshComponent(int index, WizardStep value) { DesignerActionUIService service = this.GetService(typeof (DesignerActionUIService)) as DesignerActionUIService; if (service == null) { return; } service.Refresh(this.Control); }
public void CopyTo(Array array, int index) { WizardStep[] wizs = new WizardStep[Count]; for (int i = 0; i < Count; i++) { wizs[i] = WizardSteps[i]; } Array.Copy(wizs, 0, array, index, Count); }