public void Back() { IWizardView nextView = null; if (CurrentView != null) { CurrentView.OnNavigatingAwayBackward(); } switch (CurrentStep) { case WizardStep.SelectEntities: SetStep(WizardStep.SelectStore); nextView = RootWorkItem.SmartParts.GetFirstOrCreate <SelectStoreView>(); break; case WizardStep.EditEntities: SetStep(WizardStep.SelectEntities); nextView = RootWorkItem.SmartParts.GetFirstOrCreate <SelectEntitiesView>(); break; case WizardStep.GenerateCode: SetStep(WizardStep.EditEntities); nextView = RootWorkItem.SmartParts.GetFirstOrCreate <EditEntitiesView>(); break; } if (nextView != null) { nextView.OnNavigatingToBackward(); Workspace.Show(nextView); CurrentView = nextView; } }
public void OnPageChanging(int oldPageNum, int newPageNum, IWizardView view) { switch(oldPageNum) { case 0: GameName = view.GetInput("游戏名称"); ProjectDir = view.GetPathInput("项目路径"); CreateDir = view.GetYesOrNo("是否建立目录"); break; case 1: Author = view.GetInput("作者"); IconPath = view.GetFileInput("图标"); break; } }
/// <summary> /// Sets the <see cref="WizardView"/> of the <see cref="WizardPresenter"/> /// </summary> /// <param name="view">Instance of <see cref="IWizardView"/></param> protected WizardPresenter(IWizardView view) : base(view) { if (view == null) { throw new ArgumentNullException("view"); } WizardView = view; Steps = new Dictionary <int, WizardStepPresenter>(); ViewState = new WizardStateBag(); LoadSteps(); AttachWizardView(); }
public override void ShowPage(int pageNumber, IWizardView view) { switch(pageNumber) { case 0: view.Clear(); view.SetTitle("创建项目向导 - Page1_路径设置"); view.AddInput("游戏名称", "游戏名称:", "新游戏"); view.AddPathInput("项目路径", "项目路径:", ""); view.AddYesNoChooser("是否建立目录", "是否建立项目文件夹", true); break; case 1: view.Clear(); view.SetTitle("创建项目向导 - Page2_作者信息"); view.AddInput("作者", "作者:", ""); view.AddFileInput("图标", "图标", "", "图标文件|*.ico"); break; } }
/// <summary> /// Creates an instance of<see cref="BarcodeEntryWizardPresenter"/> /// </summary> /// <param name="view">passive view</param> protected BarcodeEntryWizardPresenter(IWizardView view) : base(view) { }
// 只有将ShowSummary设置为true时才有必要实现该函数 public abstract void ShowSummary(IWizardView view);
public abstract void ShowPage(int pageNumber, IWizardView view);
/// <summary> /// Initialises a new instance of the <see cref="WizardController"/> class. /// </summary> /// <param name="view">The view to be controlled by the controller.</param> /// <param name="scenarioRunManager">The manager used to control the scenario.</param> /// <param name="uiLogic">The UI logic object to use to run scenarios and parse trace files.</param> public WizardController(IWizardView view, IScenarioRunManager scenarioRunManager, IUILogic uiLogic) { this.view = view; this.scenarioRunManager = scenarioRunManager; this.uiLogic = uiLogic; }
public override void Activate() { base.Activate(); // Save original body side mPatientBodySide = Session.PatientBodySide; if (!InitManually) { IEnumerable <ManualMeasurementItem> measurements = null; var helper = new WizardMeasurementsHelper(); if (Parameter is string) { var wizard = helper.GetWizard((string)Parameter); if (wizard != null) { measurements = wizard.SelectedMeasurements; mSkipMeasurementIfCompleted = wizard.Skip; } } else if (Parameter is IEnumerable <ManualMeasurementItem> ) { measurements = Parameter as IEnumerable <ManualMeasurementItem>; mSkipMeasurementIfCompleted = (helper.GetWizard(measurements.FirstOrDefault()?.WizardName)?.Skip).GetValueOrDefault(false); } if (ValidateMeasurementsList(measurements)) { // Init Wizard View if (mWizardView == null && ProcedureContext.AllViews.TryGetValue("Wizard", out ViewRegistrar viewRegistrar)) { var parameter = new object[] { }; mWizardView = DynamicInitializer.New <IWizardView>(viewRegistrar.ViewType, parameter); mWizardView.Init(this, Session); mWizardView.Position = DockSide.Left; mWizardView.PositionInContainer = DockContainerSide.Center; DockItems = new List <IDockItem> { mWizardView }; } ProcedureContext.OnViewComponentChange(new ViewComponentChangeArgs(ViewComponents.OpenCC, 0)); // Select first procedure if (NextProcedure()) { Session.CurrentContext.ProcedureBegin -= ProcBegin; Session.CurrentContext.ProcedureBegin += ProcBegin; mbCanClose = false; return; } } Close(); } }
public override void ShowSummary(IWizardView view) { view.Clear(); view.SetTitle("创建项目向导 - 信息确认页"); StringBuilder strBldr = new StringBuilder(); strBldr.AppendLine("1. 路径设置"); strBldr.AppendLine(" 游戏名称:" + GameName); strBldr.AppendLine(" 项目路径:" + ProjectDir); strBldr.AppendLine(" 是否建立项目文件夹:" + CreateDir); strBldr.AppendLine("2. 作者信息"); strBldr.AppendLine(" 作者:" + Author); strBldr.AppendLine(" 图标:" + IconPath); }
public void OnPageChanged(int pageNum, IWizardView view) { // ACHACK 下面这东西到底放那一层呢? }
public WizardController(IWizardView view) { WireEventsToView(view); }
private void WireEventsToView(IWizardView view) { view.MovedNext += OnMovedNext; view.MovedPrevious += OnMovedPrevious; view.Cancelled += OnCancel; _view = view; }
private void ShowWizard(IWizardView view) { view.ShowStep(CurrentStep); view.IsFirstStep(_activeWizard.IsFirstStep()); view.IsLastStep(IsLastStep()); }