コード例 #1
0
 /// <summary>
 ///     This is called when the wizard needs to cleanup things, it will call Terminate on every screen
 /// </summary>
 public virtual void Terminate()
 {
     _screenObservable?.Dispose();
     Log.Verbose().WriteLine("Terminating wizard");
     foreach (var wizardScreen in WizardScreens.OrderBy(x => x.Order))
     {
         wizardScreen.Terminate();
     }
 }
コード例 #2
0
        /// <summary>Called when activating.</summary>
        protected override void OnActivate()
        {
            // Order the items by ordering on Order
            Items.AddRange(WizardScreens.OrderBy(x => x.Order));

            Initialize();

            base.OnActivate();
        }
コード例 #3
0
        /// <summary>
        ///     This is called when the wizard needs to initialize stuff, it will call Initialize on every screen
        /// </summary>
        public virtual void Initialize()
        {
            Log.Verbose().WriteLine("Initializing wizard");

            foreach (var wizardScreen in WizardScreens.OrderBy(x => x.Order))
            {
                wizardScreen.ParentWizard = this;
                wizardScreen.Initialize();
            }
        }
コード例 #4
0
        /// <summary>
        ///     Called to check whether or not this instance can close.
        /// </summary>
        /// <param name="callback">The implementor calls this action with the result of the close check.</param>
        public override void CanClose(Action <bool> callback)
        {
            var result = true;

            foreach (var wizardScreen in WizardScreens.OrderBy(x => x.Order))
            {
                wizardScreen.CanClose(canClose => result &= canClose);
            }
            callback(result);
        }