Пример #1
0
 private void VerifyPreset(CameraPreset preset)
 {
     if (preset == null)
         return;
     var dlg = new ProgressWindow();
     dlg.Show();
     try
     {
         int i = 0;
         dlg.MaxValue = ServiceProvider.DeviceManager.ConnectedDevices.Count;
         foreach (ICameraDevice connectedDevice in ServiceProvider.DeviceManager.ConnectedDevices)
         {
             if (connectedDevice == null || !connectedDevice.IsConnected)
                 continue;
             try
             {
                 dlg.Label = connectedDevice.DisplayName;
                 dlg.Progress = i;
                 i++;
                 preset.Verify(connectedDevice);
             }
             catch (Exception exception)
             {
                 Log.Error("Unable to set property ", exception);
             }
             Thread.Sleep(250);
         }
     }
     catch (Exception exception)
     {
         Log.Error("Unable to set property ", exception);
     }
     dlg.Hide();
 }
Пример #2
0
 private void UseAsMaster()
 {
     if (dlg == null)
         dlg = new ProgressWindow();
     dlg.Show();
     Thread thread = new Thread(SetAsMaster);
     thread.Start();
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     Dispatcher.Invoke(new Action(() => btn_useasmaster.IsEnabled = false));
     if (dlg == null)
         dlg = new ProgressWindow();
     dlg.Show();
     Thread thread = new Thread(SetAsMaster);
     thread.Start();
 }