コード例 #1
0
        public void ExecuteCommand(string cmd, object param)
        {
            switch (cmd)
            {
            case WindowsCmdConsts.CameraPropertyWnd_Show:
                PhotoSessionNames.Clear();
                PhotoSessionNames.Add("(None)");
                foreach (PhotoSession photoSession in ServiceProvider.Settings.PhotoSessions)
                {
                    PhotoSessionNames.Add(photoSession.Name);
                }
                CameraPresets.Clear();
                CameraPresets.Add("(None)");
                foreach (var cameraPresets in ServiceProvider.Settings.CameraPresets)
                {
                    CameraPresets.Add(cameraPresets.Name);
                }

                _cameraDevice = param as ICameraDevice;
                if (_cameraDevice == null)
                {
                    return;
                }
                CameraProperty = _cameraDevice.LoadProperties();
                CameraProperty.BeginEdit();
                Dispatcher.Invoke(new Action(delegate
                {
                    Show();
                    Activate();
                    Topmost = true;
                    //Topmost = false;
                    Focus();
                }));
                break;

            case WindowsCmdConsts.CameraPropertyWnd_Hide:
                CameraProperty = null;
                Hide();
                break;

            case CmdConsts.All_Close:
                Dispatcher.Invoke(new Action(delegate
                {
                    Hide();
                    Close();
                }));
                break;
            }
        }
コード例 #2
0
        public void ExecuteCommand(string cmd, object param)
        {
            switch (cmd)
            {
            case WindowsCmdConsts.CameraPropertyWnd_Show:
                ((CameraPropertyViewModel)DataContext).Init();

                _cameraDevice = param as ICameraDevice;
                if (_cameraDevice == null)
                {
                    return;
                }
                CameraProperty = _cameraDevice.LoadProperties();
                CameraProperty.BeginEdit();
                Dispatcher.Invoke(new Action(delegate
                {
                    Owner = ServiceProvider.PluginManager.SelectedWindow as Window;
                    Show();
                    Activate();
                    Focus();
                }));
                break;

            case WindowsCmdConsts.CameraPropertyWnd_Hide:
                CameraProperty = null;
                Hide();
                break;

            case CmdConsts.All_Close:
                Dispatcher.Invoke(new Action(delegate
                {
                    Hide();
                    Close();
                }));
                break;
            }
        }