Esempio n. 1
0
 /// <summary>
 ///     Handles the message.
 /// </summary>
 /// <param name="message">The message.</param>
 public void Handle(EngineRegistrySettingsChanged message)
 {
     using (var reg = new EngineRegistrySettings())
     {
         ShowControls = reg.GetOrCreate("ShowControls", true);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Handles the message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Handle(ShellReady message)
        {
            using (var reg = new EngineRegistrySettings())
            {
                captureEngine.CaptureMethod = reg.CaptureMethod;
                captureEngine.Speed         = (int)reg.Speed;
            }

            this.captureEngine.StartAsync();
        }
Esempio n. 3
0
        /// <summary>
        ///     Handles the message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Handle(ShellReady message)
        {
            bool autoStart;

            using (var reg = new EngineRegistrySettings())
            {
                captureEngine.CaptureMethod = reg.CaptureMethod;
                captureEngine.Speed         = reg.Speed;
                autoStart = reg.AutoStart;
            }

            if (autoStart)
            {
                captureEngine.StartAsync();
            }
        }
Esempio n. 4
0
        public StartStopCommandBarViewModel(
            IEventAggregator eventAggregator,
            ICaptureEngine captureEngine)
        {
            Order                   = -2;
            _captureEngine          = captureEngine;
            _captureEngine.Started += CaptureEngine_Started;
            _captureEngine.Stopped += CaptureEngine_Stopped;
            eventAggregator.Subscribe(this);
            IsStarted = captureEngine.IsRunning;

            using (var reg = new EngineRegistrySettings())
            {
                ShowControls = reg.GetOrCreate("ShowControls", true);
            }
        }
 private void LoadSettings()
 {
     using (PauseNotify.For(this))
     {
         using (var reg = new EngineRegistrySettings())
         {
             this.SelectedSpeed = this.Speeds.FirstOrDefault(speed => (int)speed.Value == reg.Speed);
             this.SelectedEngine = this.Engines.FirstOrDefault(key => (CaptureMethod)key.Value == reg.CaptureMethod);
         }
     }
 }
        private async void UpdateSettings()
        {
            if (PauseNotify.IsPaused(this)) return;

            this.captureEngine.Speed = (int)this.SelectedSpeed.Value;
            this.captureEngine.CaptureMethod = ((CaptureMethod)this.SelectedEngine.Value);
            using (var reg = new EngineRegistrySettings())
            {
                reg.Speed = (int)this.SelectedSpeed.Value;
                reg.CaptureMethod = (CaptureMethod)this.SelectedEngine.Value;
            }
        }
 private void LoadSettings()
 {
     using (PauseNotify.For(this))
     {
         using (var reg = new EngineRegistrySettings())
         {
             SelectedSpeed = Speeds.FirstOrDefault(speed => (int)speed.Value == reg.Speed);
             SelectedEngine = Engines.FirstOrDefault(key => (CaptureMethod)key.Value == reg.CaptureMethod);
             AutoStart = reg.AutoStart;
             ShowControls = reg.GetOrCreate("ShowControls", true);
         }
     }
 }
        private void UpdateSettings()
        {
            if (PauseNotify.IsPaused(this))
            {
                return;
            }

            _captureEngine.Speed = (int)SelectedSpeed.Value;
            _captureEngine.CaptureMethod = ((CaptureMethod)SelectedEngine.Value);
            using (var reg = new EngineRegistrySettings())
            {
                reg.Speed = (int)SelectedSpeed.Value;
                reg.CaptureMethod = (CaptureMethod)SelectedEngine.Value;
                reg.AutoStart = AutoStart;
                reg.SetValue("ShowControls", ShowControls);
                _events.PublishOnBackgroundThread(new EngineRegistrySettingsChanged());
            }
        }