/// <summary> /// Inits wizard state. /// </summary> private void _Init(Type[] _pageInfos, WizardDataContext dataContext) { Debug.Assert(!_isInited); _dataContext = dataContext; foreach (Type pageType in _pageInfos) { // Create page. var page = (WizardPageBase)Activator.CreateInstance(pageType); page.Initialize(_dataContext); // Attach to supported page event. if (page is ISupportNext) { ((ISupportNext)page).NextRequired += new EventHandler(OnNextRequired); } if (page is ISupportBack) { ((ISupportBack)page).BackRequired += new EventHandler(_OnBackRequired); } if (page is ISupportCancel) { ((ISupportCancel)page).CancelRequired += new EventHandler(_OnCancelRequired); } if (page is ISupportFinish) { ((ISupportFinish)page).FinishRequired += new EventHandler(_OnFinishRequired); } _pages.Add(page); } PostInit(); _isInited = true; }
/// <summary> /// Inits state. /// </summary> /// <param name="dataContext">Fleet setup wizard data keeper.</param> public virtual void Initialize(WizardDataContext dataContext) { Debug.Assert(null != dataContext); _dataContext = dataContext; }
/// <summary> /// Constructor. /// </summary> /// <param name="pages">Pages types.</param> /// <param name="dataContext">Wizard data context.</param> public WizardBase(Type[] pages, WizardDataContext dataContext) { _Init(pages, dataContext); }