Example #1
0
        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);
            }
        }
Example #2
0
        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);
        }
Example #5
0
 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);
     });
 }
Example #6
0
        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);
        }
Example #7
0
        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);
        }
Example #8
0
        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();
        }
Example #10
0
        public override void OnEnter(CRMPage previousPage, CRMPageArgs args)
        {
            SetupSelector();

            base.OnEnter(previousPage, args);
        }
Example #11
0
 protected void SetSubPage(Type nextPage, CRMPageArgs args = null, Action <CRMPage> returnAction = null)
 {
     Manager.SetSubPage(nextPage, returnAction, args);
 }
Example #12
0
 protected void SetPage(Type nextPage, CRMPageArgs args = null)
 {
     Manager.SetPage(nextPage, args);
 }
Example #13
0
 public abstract void OnEnter(CRMPage previousPage, CRMPageArgs args);