private void OnRemoveClick(object sender, EventArgs e) { WizardForm ctrl = ( WizardForm )Control; if (ctrl.Pages.Count > 0 && ctrl.PageIndex > 0) { ctrl.Pages.RemoveAt(ctrl.PageIndex); } }
protected override bool GetHitTest(System.Drawing.Point point) { WizardForm ctrl = ( WizardForm )Control; if (ctrl != null) { Point p = ctrl.PointToClient(point); return(ctrl.OnDesignedWizardButtons(p)); } return(base.GetHitTest(point)); }
private void OnAddPageClick(object sender, EventArgs e) { WizardForm ctrl = ( WizardForm )Control; WizardPageBase page = new WizardPageBase(); ctrl.Pages.Add(page); IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); if (host != null) { host.Container.Add(page); } }
/// <summary> /// Custom Drawing of Wizard Page in IDE Designer /// </summary> /// <param name="pe"></param> protected override void OnPaintAdornments(System.Windows.Forms.PaintEventArgs pe) { base.OnPaintAdornments(pe); Graphics g = pe.Graphics; WizardPageBase page = Control as WizardPageBase; if (page == null) { page = Component as WizardPageBase; } if (page != null) { WizardForm parent = page.WizardPageParent; string strPos; if (page != null && parent != null) { strPos = (parent.Pages.IndexOf(page) + 1).ToString(); } else // if something wrong then simply show MINUS { strPos = "-"; if (page == null) { strPos += "p"; } if (parent == null) { strPos += "P"; } } g.FillRectangle(m_brushBack, m_rect); StringFormat frmString = new StringFormat(); frmString.Alignment = StringAlignment.Center; frmString.LineAlignment = StringAlignment.Center; g.DrawString(strPos, m_font, m_brushText, m_rect, frmString); } }
public WizardPagesCollection( WizardForm parent ) { m_parent = parent; }
private void m_wizard_Finish(object sender, WizardForm.EventNextArgs e) { try { m_parameterSetList = new List<ParameterSet>(); //由于控件不全,这里做一次转换,将String转成对应类型,后面做全了再删除 ParameterSet paras = null; String strValue; m_index = 0; ParameterSet parasResult = null; foreach (ParameterWizard wizPage in m_wizPages) { paras = wizPage.ParameterSet; parasResult = new ParameterSet(); parasResult.ID = paras.ID; parasResult.Name = paras.Name; foreach (KeyValuePair<String, Object> pair in paras) { if (pair.Value is String) { parasResult[pair.Key] = Reductor(pair.Key, pair.Value as String); } else { parasResult[pair.Key] =pair.Value; } } //m_parameterSetList.Add(wizPage.ParameterSet); m_parameterSetList.Add(parasResult); ++m_index; } } catch (Exception ex) { IRunningLogger logger = InstanceManager.Instance.Context.GetVariable("RunningStatusLogger") as IRunningLogger; if (null != logger) { logger.Error(_LOG, ex.Message); } } }
public WizardPagesCollection(WizardForm parent) { m_parent = parent; }
/// <summary> /// Custom Drawing of Wizard Page in IDE Designer /// </summary> /// <param name="pe"></param> protected override void OnPaintAdornments(System.Windows.Forms.PaintEventArgs pe) { base.OnPaintAdornments(pe); Graphics g = pe.Graphics; Rectangle rect;// = pe.ClipRectangle; WizardPageBase page = Control as WizardPageBase; if (page == null) { page = Component as WizardPageBase; } WizardForm parent = (page != null) ? page.WizardPageParent : null; string strPos; if (page != null && parent != null) { strPos = (parent.Pages.IndexOf(page) + 1).ToString(); } else // if something wrong then simply show MINUS { strPos = "-"; if (page == null) { strPos += "p"; } if (parent == null) { strPos += "P"; } } g.FillRectangle(m_brushBack, m_rect); StringFormat frmString = new StringFormat(); frmString.Alignment = StringAlignment.Center; frmString.LineAlignment = StringAlignment.Center; g.DrawString(strPos, m_font, m_brushText, m_rect, frmString); if (parent != null) { rect = parent.GetCurrentPageRect(); if (rect.Width % 8 > 0) { rect.Width = (int)(rect.Width / 8) * 8; } if (rect.Height % 8 > 0) { rect.Height = (int)(rect.Height / 8) * 8; } if (page != null && page.WelcomePage == false && m_bShowLines == true) { Point[] pnt = new Point[] { new Point(new Size(rect.X + 24, rect.Y + 8)), new Point(new Size(rect.X + 24, rect.Bottom - 8)), new Point(new Size(rect.X + 40, rect.Bottom - 8)), new Point(new Size(rect.X + 40, rect.Y + 8)), new Point(new Size(rect.X + 56, rect.Y + 8)), new Point(new Size(rect.X + 56, rect.Bottom - 8)), new Point(new Size(rect.Right - 56, rect.Bottom - 8)), new Point(new Size(rect.Right - 56, rect.Y + 8)), new Point(new Size(rect.Right - 40, rect.Y + 8)), new Point(new Size(rect.Right - 40, rect.Bottom - 8)), new Point(new Size(rect.Right - 24, rect.Bottom - 8)), new Point(new Size(rect.Right - 24, rect.Y + 8)), new Point(new Size(rect.X + 24, rect.Y + 8)), new Point(new Size(rect.X + 24, rect.Bottom - 8)), new Point(new Size(rect.Right - 24, rect.Bottom - 8)) }; Pen pen = new Pen(Brushes.Black); pen.DashStyle = DashStyle.DashDotDot; g.DrawLines(pen, pnt); pen.Dispose(); } } }