Beispiel #1
0
        void OnPortalClosing(object sender, CancelEventArgs e)
        {
            CameraDevice device = ((CameraPortal)sender).SelectedDevice;

            if (device != null)
            {
                try {
                    ShowDevice(device);
                }
                catch (Exception ex) {
                    Logger.Error(this, "Unable to open camera window", ex);
                }
            }
        }
Beispiel #2
0
        void IRunnableModule.Start()
        {
            try {
                CameraDevice device = JSON.Read <CameraDevice>(context.Settings.Get <string>(this, "lastdevice"));
                if (device != null)
                {
                    ShowDevice(device);
                }
            }
            catch (Exception e) {
            }

            context.GetModuleByKey <IMainWindow>(ModuleKeys.MainWindow).AddMenuItem("Display.Camera", (sender, args) => {
                CameraPortal portal = new CameraPortal();
                portal.Closing     += OnPortalClosing;
                portal.ShowDialog();
            });
        }
Beispiel #3
0
 private void OnCameraClosed(object sender, EventArgs e)
 {
     context.Settings.Set(this, "lastdevice", null);
     current        = null;
     currentprocess = null;
 }