private void Form1_FormClosing(object sender, FormClosingEventArgs e) { video_interval.Enabled = false; ServerHttpListener.StopThread(); DeviceController.StopAllDevices(false); Configuration.SaveConfiguration(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { video_interval.Enabled = false; ServerHttpListener.StopThread(); _controller.Exit(); // TODO: Implements automatic bind devices //_controller.ctxApp.Config.Ctx.Devices = DeviceController.BindDeviceConfiguration(); _controller.SaveConfig(); }
public void ApplyContext() { Config = _config.Load(); // Services try { if (Config.EnableServer) { ServerHttpListener.StratThread(); } else { ServerHttpListener.StopThread(); } } catch (Exception) { _notify.FailMessage("Falha ao inicializar serviços!"); } //Devices foreach (var videoCapture in _videosCapture) { // Timer if (Config.EnableInterval) { videoCapture.StartDevice(); videoCapture.StartVideo(); } videoCapture.UpdateConfig(); } _view.UpdateConfig(); }