private void ApplySettings()
 {
     imageCapture.UpdateCamera(settings.Camera);
     imageCapture.UpdateFramePause(settings.FramePause);
     imageCapture.UpdateMaxFrameCounter(settings.MaximumSteps);
     if (settings.model)
     {
         imageCapture.Pause();
         lock (locker)
             BufferPhaseImage = null;
         imageCapture2.PauseRelease();
     }
     else
     {
         imageCapture2.Pause();
         lock (locker)
             BufferPhaseImage = null;
         imageCapture.PauseRelease();
     }
 }
        private void ApplySettings()
        {
            imageCapture.UpdateCamera(settings.Camera);
            imageCapture.UpdateFramePause(settings.FramePause);
            imageCapture.UpdateMaxFrameCounter(settings.MaximumSteps);
            if (settings.model)
            {
                imageCapture.Pause();
                lock (locker)
                    BufferPhaseImage = null;
                imageCapture2.PauseRelease();
            }
            else
            {
                imageCapture2.Pause();
                lock (locker)
                    BufferPhaseImage = null;
                imageCapture.PauseRelease();
            }

            if (settings.arduino)
            {
                if (ArduinoWorker == null)
                {
                    ArduinoWorker = new ArduinoWorker();
                    ArduinoWorker.init();
                    imageCapture.action += ArduinoWorker.Action;
                }
            }
            else
            {
                if (ArduinoWorker != null)
                {
                    ArduinoWorker.Stop();
                    imageCapture.action -= ArduinoWorker.Action;
                    ArduinoWorker        = null;
                }
            }
        }