コード例 #1
0
 private void cbDevices_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (deviceDropDownOpened)
     {
         _videoHandler.Stop();
         _videoHandler.Start();
         deviceDropDownOpened = false;
     }
 }
コード例 #2
0
        private void Startup()
        {
            using (new Splash(this))
            {
                AppDataContext = new AppDataContext()
                {
                    Devices               = new ObservableCollection <string>(),
                    StrokeCollection      = new System.Windows.Ink.StrokeCollection(),
                    VideoImage            = null,
                    VideoSelectedImage    = null,
                    ImageDifference       = null,
                    FrameRate             = 0,
                    ImageChangePercentage = 0.0,
                    Status = string.Empty
                };

                AppDataContext.NotifyIconHandler = new NotifyIconHandler(AppDataContext, Properties.Resources.Icon,
                                                                         Properties.Resources.Icon_Working);
                AppDataContext.NotifyIconHandler.OnClickEvent += () =>
                {
                    WindowState = System.Windows.WindowState.Maximized;
                    Topmost     = true;
                    Show();
                    Topmost = false;
                };

                (AppDataContext.Controllers = (Controllers = new ControllerInitialiser(AppDataContext))).InitialiseControllers();

                _videoHandler = new VideoWrapper(AppDataContext);
                _videoHandler.TriggerEvent += Video_TriggerEvent;
                _videoHandler.GetDevices();
                _videoHandler.Start();

                this.DataContext = AppDataContext;
            }
        }