Esempio n. 1
0
 private void OnSetupControlEvent(MsgSetupControl obj)
 {
     switch (obj.Typ)
     {
         case SetupEventType.Started_ImgSetup:
         case SetupEventType.Finished_ImgSetup:
         case SetupEventType.Started_MHSetup:
         case SetupEventType.Finished_MHSetup:
             break;
         case SetupEventType.Ui_in_position:
             autoEvent.Set(); // proceed
             break;
         default:
             break;
     }
 }
Esempio n. 2
0
        public void NotifySetupEvent(int incr)
        {
            MsgSetupControl msg = new MsgSetupControl() { Typ = SetupEventType.Started_ImgSetup };

            if (incr == 0) // 0 = StartSetup
            {
                // Subscribe to the event, when UI is ready
                EA.GetEvent<MsgSetupControl>().Subscribe(OnSetupControlEvent);

                // Publish and therefore trigger the Navigation-process
                EA.GetEvent<MsgSetupControl>().Publish(msg);

                Log.Debug("Waiting for setup-UI to be loaded");
                autoEvent.WaitOne(); // wait
                Log.Debug("Proceed because setup-UI is ready");
            }
            else if (incr == 1) // 1 = FinishedSetup
            {
                msg.Typ = SetupEventType.Finished_MHSetup;
                // Publish and therefore trigger the Navigation-process to Level
                EA.GetEvent<MsgSetupControl>().Publish(msg);
            }
        }
Esempio n. 3
0
        private void OnSetupControlEvent(MsgSetupControl obj)
        {
            // Note: do everything here synchronously!

            switch (obj.Typ)
            {
                case SetupEventType.Ui_in_position:
                    // Change the color to the desired values early enough
                    List<byte> colors = Conf.GetCsvSetting<byte>("mhSetupColors");
                    for (int i = 0; i < colors.Count; i++)
                    {
                        MhSvc.SetColor(colors[i], i);
                    }
                    break;
                case SetupEventType.Started_ImgSetup:
                case SetupEventType.Finished_ImgSetup:
                    break;
                case SetupEventType.Started_MHSetup:
                    DoSetup();
                    break;
                case SetupEventType.Finished_MHSetup:
                    break;
                default:
                    break;
            }
        }
Esempio n. 4
0
        private void OnSetupControlEvent(MsgSetupControl obj)
        {
            // Note: do everything here synchronously!

            switch (obj.Typ)
            {
                case SetupEventType.Ui_in_position:
                case SetupEventType.Started_ImgSetup:
                case SetupEventType.Finished_ImgSetup:
                    // You are interested in this case
                    Log.DebugFormat("Finished_ImgSetup - ImgSetupPositions.Count: {0}", ImgSetupPositions.Count);
                    if (ImgSetupPositions.Count >= 4)
                    {
                        ImgSetupDone = true;
                    }
                    break;
                case SetupEventType.Started_MHSetup:
                case SetupEventType.Finished_MHSetup:
                    break;
                default:
                    break;
            }
        }
Esempio n. 5
0
 private void OnSetupControlEvent(MsgSetupControl obj)
 {
     switch (obj.Typ)
     {
         case SetupEventType.Started_ImgSetup:
             RegionHelper.ResetMainView(RegMgnr);
             RegMgnr.RequestNavigate(RegionNames.MainRegion, new Uri("/FHVGame.GameLogic.Client.Controls.Setup", UriKind.RelativeOrAbsolute), WhenDone);
             break;
         case SetupEventType.Ui_in_position:
             break;
         case SetupEventType.Finished_ImgSetup:
             break;
         case SetupEventType.Started_MHSetup:
             break;
         case SetupEventType.Finished_MHSetup:
             //RegionHelper.ResetMainView(RegMgnr);
             //RegMgnr.RequestNavigate(RegionNames.MainRegion, new Uri("/FHVGame.GameLogic.Client.Controls.GameBoard", UriKind.RelativeOrAbsolute));
             break;
         default:
             break;
     }
 }
Esempio n. 6
0
 private void OnGameSetupEvent(MsgSetupControl obj)
 {
     switch (obj.Typ)
     {
         case SetupEventType.Started_ImgSetup:
             StartProcessAsync(Conf.GetSetting<string>("binImgParser"), Conf.GetSetting<string>("imgParseSetupArgs"));
             break;
         case SetupEventType.Ui_in_position:
             KillProc();
             break;
         case SetupEventType.Finished_ImgSetup:
             StartProcessAsync(Conf.GetSetting<string>("binImgParser"), Conf.GetSetting<string>("imgParseMHSetupArgs"));
             break;
         case SetupEventType.Started_MHSetup:
             break;
         case SetupEventType.Finished_MHSetup:
             KillProc();
             break;
         default:
             break;
     }
 }