public override void OnEnter(CRMPage previousPage, CRMPageArgs args) { exited = false; string msg = args.GetString(PARAM_MESSAGE); if (msg != null) { action = args.GetString(PARAM_ACTION); message = msg; DisplayText(msg, action ?? ""); } else { DisplayText(message, this.action ?? ""); } float?timeout = args.GetFloat(PARAM_TIMEOUT); if (timeout.HasValue) { waitForTimeoutCancellation = new CancellationTokenSource(); WaitForTimeout(timeout.Value); } }
public override void OnEnter(CRMPage previousPage, CRMPageArgs args) { SelectTownPage townPage = previousPage as SelectTownPage; selectedTownCode = townPage.SelectedTownCode; SetupSelector(); base.OnEnter(previousPage, args); }
public override void OnEnter(CRMPage previousPage, CRMPageArgs args) { SelectStationPage stationPage = previousPage as SelectStationPage; selectedTownStationCode = stationPage.SelectedTownStationCode; Terminal.Log(selectedTownStationCode); SetupSelector(); base.OnEnter(previousPage, args); }
public override void OnEnter(CRMPage previousPage, CRMPageArgs args) { Terminal.Log("CruiseControlPage.OnEnter"); SetupSelector(); RestoreSelectorIndex(); LocoCruiseControl.OnCruiseControlChange += LocoCruiseControl_OnCruiseControlChange; base.OnEnter(previousPage, args); }
public override void OnEnter(CRMPage previousPage, CRMPageArgs args) { // call sequentionaly all three pages SetSubPage(typeof(SelectTownPage), null, (townPage) => { Manager.SetSubPage(typeof(SelectStationPage), (stationPage) => { //here we should be ruterned back to caller Manager.SetPage(typeof(SelectTrackPage), null, stationPage); }, null, townPage); }); }
internal void CallMessageSubPage(string message, string action, float?timeout = null, Action <CRMPage> returnAction = null) { CRMPageArgs args = new CRMPageArgs(); args.AddString(MessagePage.PARAM_MESSAGE, message); args.AddString(MessagePage.PARAM_ACTION, action); if (timeout.HasValue) { args.AddFloat(MessagePage.PARAM_TIMEOUT, timeout.Value); } SetSubPage(typeof(MessageSubPage), args, returnAction); }
internal void RedirectToMessagePage(string message, string action, float?timeout = null) { CRMPageArgs args = new CRMPageArgs(); args.AddString(MessagePage.PARAM_MESSAGE, message); args.AddString(MessagePage.PARAM_ACTION, action); if (timeout.HasValue) { args.AddFloat(MessagePage.PARAM_TIMEOUT, timeout.Value); } SetPage(typeof(MessagePage), args); }
public override void OnEnter(CRMPage previousPage, CRMPageArgs args) { if (Module.VersionForUpdate != null && !updateExecuted) { DisplayText($"NEW VERSION {Module.VersionForUpdate.Version} AVAILABLE!", "UPDATE"); updateExecuted = true; Module.StartCoroutine(DoUpdate()); } else { SetMainDisplay(); } }
public override void OnEnter(CRMPage previousPage, CRMPageArgs args) { if (!selectorSetup) { if (!SetupSelector()) { //selector setup failed, so create at least exit menu menuSelector = new Selector <MenuItem>(new List <MenuItem>() { GetExitMenu() }); } } PrintCurrentSelector(); }
public override void OnEnter(CRMPage previousPage, CRMPageArgs args) { SetupSelector(); base.OnEnter(previousPage, args); }
protected void SetSubPage(Type nextPage, CRMPageArgs args = null, Action <CRMPage> returnAction = null) { Manager.SetSubPage(nextPage, returnAction, args); }
protected void SetPage(Type nextPage, CRMPageArgs args = null) { Manager.SetPage(nextPage, args); }
public abstract void OnEnter(CRMPage previousPage, CRMPageArgs args);