Пример #1
0
        void ConfigWriteToFileIfChanged()
        {
            var config = Dispatcher.Invoke(ConfigFromViewToModel);

            if (ConfigAttemptWriteToFileLast?.SerializeToString() == config?.SerializeToString())
            {
                return;
            }

            ConfigAttemptWriteToFileLast = config;

            Bib3.Extension.WriteToFileAndCreateDirectoryIfNotExisting(ConfigFilePath, config.SerializeToUtf8());
        }
Пример #2
0
 protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
 {
     base.OnClosing(e);
     try
     {
         SaveLayout();
         PublicTransport.ApplicationEventBus.PublishWait(new ShutdownEvent());
         ExeConfig.Save();
     }
     catch (Exception ex)
     {
         if (null == Logger)
         {
             return;
         }
         Logger.Log(LogLevel.Error, this, ex.ToString());
     }
 }
Пример #3
0
		void Timer_Tick(object sender, object e)
		{
			ProcessUIInput();

			if (OperationModeChoiceIsBotSessionNewStart)
			{
				FromUIConfig = Window?.ExeOpModesAggregatedControl?.ConfigFromViewToModel();

				SensorExchange();

				LicenseClientExchange();

				BotExchange();

				ActMotion();
			}

			Present();
		}
Пример #4
0
 /// <summary>
 /// Raises the <see cref="E:System.Windows.Application.Exit" /> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.Windows.ExitEventArgs" /> that contains the event data.</param>
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     if (shutdownOnEvent)
     {
         return;
     }
     if (null == publicTransport)
     {
         return;
     }
     if (null == publicTransport.ApplicationEventBus)
     {
         logger.Log(LogLevel.Error, this, "Cannot find Event bus to notify application shutdown");
         return;
     }
     publicTransport.ApplicationEventBus.PublishWait(new ShutdownEvent());
     ExeConfig.Save();
 }
Пример #5
0
        static void GameBot()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var config         = new ExeConfig();
            var engineMode     = config.Read("Robot.Engine.Mode", "Emulated");
            var logLevelString = config.Read("Robot.Ui.LogLevel", "Error");

            using (var container = new Container())
            {
                // register packages
                if (engineMode == "Emulated")
                {
                    container.RegisterPackages(GetEmulatedEngineAssembies());
                }
                if (engineMode == "Physical")
                {
                    container.RegisterPackages(GetPhysicalEngineAssembies());
                }

                // verify packages
                container.Verify();

                // config logging framework
                ConfigureLogging(logLevelString);
                var logger = LogManager.GetCurrentClassLogger();

                try
                {
                    Application.Run(container.GetInstance <Window>());
                }
                catch (Exception ex)
                {
                    logger.Fatal(ex);
                }
            }
        }
Пример #6
0
 public void ConfigFromModelToView(ExeConfig config)
 {
     InterfaceControl?.ProcessConfigViewModel?.PropagateFromClrMemberToDependencyProperty(config?.BrowserProcess);
 }
Пример #7
0
 BrowserProcessConfig BrowserProcessConfigCreate() =>
 ExeConfig.BrowserProcessConfigDefaultCreate(
     ConfigFromViewToModel()?.BrowserProcess,
     Bib3.FCL.Glob.ZuProcessSelbsctMainModuleDirectoryPfaadBerecne().PathToFilesysChild("Browser.UserData"));
Пример #8
0
 public void ConfigFromModelToView(ExeConfig config)
 {
     Interface.LicenseView?.LicenseClientConfigViewModel?.PropagateFromClrMemberToDependencyProperty(
         config?.LicenseClient?.CompletedWithDefault());
 }
Пример #9
0
 public void ConfigWriteToUI(ExeConfig Config)
 {
     Window?.Main?.ConfigFromModelToView(Config);
 }
Пример #10
0
		public void ConfigWriteToUI(ExeConfig Config)
		{
			Window?.Main?.ConfigFromModelToView(Config);
		}
Пример #11
0
		public void ConfigFromModelToView(ExeConfig Config)
		{
			LicenseClientConfigControl.DataContext =
				new AutoDependencyPropertyComp<BotEngine.LicenseClientConfig>(Config?.LicenseClient);
		}
Пример #12
0
 public void ConfigFromModelToView(ExeConfig Config)
 {
     LicenseClientConfigControl.DataContext =
         new AutoDependencyPropertyComp <BotEngine.Client.LicenseClientConfig>(Config?.LicenseClient);
 }
Пример #13
0
		public void ConfigWriteToUI(ExeConfig Config)
		{
			Window.ExeOpModesAggregatedControl.ConfigFromModelToView(Config);
		}
Пример #14
0
 private void OnShutdown(ShutdownEvent shutdownEvent)
 {
     shutdownOnEvent = true;
     Shutdown();
     ExeConfig.Save();
 }