Beispiel #1
0
 protected override void BindCommands()
 {
     WebsiteHyperlinkCommand = new RelayCommand<Uri>((uri) =>
       {
     Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
       });
 }
        protected override void BindCommands()
        {
            CancelCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.DeviceConfiguration_CancelUpdateVideoSourceEvent));
              });

              OKCommand = new RelayCommand(CreateVideoSource);
        }
        public virtual void SetObject(VideoSourceDescription videoSourceDescription)
        {
            VideoSourceDescription = videoSourceDescription;

              if (VideoSourceDescription != null)
              {
            OKCommand = new RelayCommand(UpdateVideoSource);
              }
              else
              {
            OKCommand = new RelayCommand(CreateVideoSource);
              }
        }
        protected override void BindCommands()
        {
            base.BindCommands();

              OKCommand = new RelayCommand(() =>
              {
            Camera camera = MakeCamera();
            if (camera != null)
            {
              Status = ViewModelStatus.Saving;
              Model.UpdateCamera(camera, UpdateCameraCallback);
            }
              });
        }
        protected override void BindCommands()
        {
            SelectLocalCameraVideoSourceCommand = new RelayCommand(() =>
              {
            Status = ViewModelStatus.Initializing;
            CameraFilterModel.GetCameraFilters(GetCameraFiltersCallback);
              });
              SelectLocalAVIFileVideoSourceCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.DeviceConfiguration_SelectLocalAVIFileVideoSourceEvent));
              });
              SelectLocalDesktopVideoSourceCommand = new RelayCommand(() =>
              {
            Status = ViewModelStatus.Initializing;
            DesktopFilterModel.GetDesktopFilters(GetDesktopFiltersCallback);
              });
              SelectNetworkJPEGCameraVideoSourceCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.DeviceConfiguration_SelectNetworkJPEGVideoSourceEvent));
              });
              SelectNetworkMJPEGCameraVideoSourceCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.DeviceConfiguration_SelectNetworkMJPEGVideoSourceEvent));
              });

              CancelCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.DeviceConfiguration_CancelNavigateVideoSourceEvent));
              });
        }
        protected override void BindCommands()
        {
            RefreshServiceCommand = new RelayCommand(() =>
              {
            ServiceCollection.Clear();
            Status = ViewModelStatus.Initializing;
            Model.GetServices(GetServicesCallback);
              });

              SelectServiceCommand = new RelayCommand(() =>
              {
            if (SelectedService == null)
            {
              Messenger.Default.Send(new ViewModelMessageBoxMessage(this, LanguageString.Find("PublishMedia_PublishServiceSelectionView_SelectedServiceNull"), ViewModelMessageBoxType.Error));
              return;
            }

            Messenger.Default.Send(new NotificationMessage<PublishPair>(UIMessageType.PublishMedia_ServiceSelectedEvent, new PublishPair(SelectedService, SelectedCamera)));
              });

              CancelCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.PublishMedia_CancelSelectServiceEvent));
              });
        }
Beispiel #7
0
        protected override void BindCommands()
        {
            SearchCameraCommand = new RelayCommand(() =>
              {
            Status = ViewModelStatus.Loading;
            CameraCollection.Clear();
            Model.SearchCameras(SearchCameraText, SearchCamerasCallback);
              });

              RefreshCameraCommand = new RelayCommand(() =>
              {
            SearchCameraText = string.Empty;
            Refresh();
              });

              PublishCameraCommand = new RelayCommand(() =>
              {
            if (SelectedCamera == null)
            {
              Messenger.Default.Send(new ViewModelMessageBoxMessage(this, LanguageString.Find("PublishMedia_CameraListView_PublishCameraNull"), ViewModelMessageBoxType.Error));
              return;
            }

            Messenger.Default.Send(new NotificationMessage<Camera>(UIMessageType.PublishMedia_CameraSelectedEvent, SelectedCamera));
              });

              CancelCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.PublishMedia_CancelSelectCameraEvent));
              });
        }
 protected override void UnbindCommands()
 {
     SelectLocalCameraVideoSourceCommand = null;
       SelectLocalAVIFileVideoSourceCommand = null;
       SelectLocalDesktopVideoSourceCommand = null;
       SelectNetworkJPEGCameraVideoSourceCommand = null;
       SelectNetworkMJPEGCameraVideoSourceCommand = null;
       CancelCommand = null;
 }
 protected override void UnbindCommands()
 {
     OKCommand = null;
       CancelCommand = null;
       CheckCameraNameCommand = null;
       SelectVideoSourceCommand = null;
 }
 protected override void UnbindCommands()
 {
     CreateCommand = null;
       UpdateCommand = null;
       DeleteCommand = null;
       CancelCommand = null;
       RefreshCommand = null;
 }
Beispiel #11
0
        protected override void BindCommands()
        {
            ColorSelectedCommand = new RelayCommand(() =>
              {
            SkinColorType colorType = BooleanToSkinColorType();
            SkinHelper.LoadSkin(colorType);
            SaveSkin(colorType);
              });

              CancelCommand = new RelayCommand(() =>
              {
            SkinColorTypeToBoolean(DefaultColorType);
            SkinHelper.LoadSkin(DefaultColorType);
            Messenger.Default.Send(new NotificationMessage(this, UIMessageType.SkinConfiguration_CloseWindowEvent));
              });

              OKCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(this, UIMessageType.SkinConfiguration_CloseWindowEvent));
              });
        }
Beispiel #12
0
        protected override void BindCommands()
        {
            LoginCommand = new RelayCommand(() =>
              {
            Login();
              });

              ExitCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Common_CloseWindowEvent));
              });
        }
        protected override void BindCommands()
        {
            CreateCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.PublishMedia_CreatePublishedCameraEvent));
              });

              DeleteCommand = new RelayCommand(() =>
              {
            if (SelectedPublishedCamera == null)
            {
              Messenger.Default.Send(new ViewModelMessageBoxMessage(this, LanguageString.Find("PublishMedia_PublishedCameraManagementView_SelectTargetDeletePublishedCamera"), ViewModelMessageBoxType.Error));
              return;
            }

            Status = ViewModelStatus.Saving;
            Model.UnpublishCamera(SelectedPublishedCamera.PublishServiceUri, SelectedPublishedCamera, UnpublishCameraCallback);
              });

              RefreshCommand = new RelayCommand(() =>
              {
            Refresh();
              });
        }
Beispiel #14
0
        static NavigationCommands()
        {
            #region Device

              ManageCameraCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_ManageCameraEvent));
              });

              #endregion

              #region LiveVideo

              ShowLiveVideoCameraListCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_ShowLiveVideoCameraListEvent));
              });

              #endregion

              #region Publish

              PublishMediaCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_PublishMediaEvent));
              });

              #endregion

              #region Layout

              ChangeLayoutCascadeCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage<MDILayoutType>(
              UIMessageType.Navigation_ChangeLayoutCascadeEvent, MDILayoutType.Cascade));
              });

              ChangeLayoutTileHorizontalCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage<MDILayoutType>(
              UIMessageType.Navigation_ChangeLayoutTileHorizontalEvent, MDILayoutType.TileHorizontal));
              });

              ChangeLayoutTileVerticalCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage<MDILayoutType>(
              UIMessageType.Navigation_ChangeLayoutTileVerticalEvent, MDILayoutType.TileVertical));
              });

              #endregion

              #region Options

              UpdateSkinCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_UpdateSkinEvent));
              });

              ChangeLanguage_zh_CN_Command = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_ChangeLanguage_zh_CN_Event));
              });

              ChangeLanguage_en_US_Command = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_ChangeLanguage_en_US_Event));
              });

              #endregion

              #region Help

              HelpOnlineCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_HelpOnlineEvent));
              });
              CheckUpdateCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_CheckUpdateEvent));
              });
              ReportBugCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_ReportBugEvent));
              });
              SeeAboutCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.Navigation_SeeAboutEvent));
              });

              #endregion
        }
        protected override void BindCommands()
        {
            RefreshServiceCommand = new RelayCommand(() =>
              {
            ServiceCollection.Clear();
            Status = ViewModelStatus.Initializing;
            Model.GetServices(GetServicesCallback);
              });

              ConnectServiceCommand = new RelayCommand(() =>
              {
            if (SelectedService == null)
            {
              Messenger.Default.Send(new ViewModelMessageBoxMessage(this, LanguageString.Find("DeviceConfiguration_ServiceSelectionView_PleaseSelectService"), ViewModelMessageBoxType.Error));
              return;
            }

            // navigate to camera list view
            Messenger.Default.Send(new NotificationMessage<MediaService>(UIMessageType.DeviceConfiguration_ServiceSelectedEvent, SelectedService));
              });
        }
        protected override void BindCommands()
        {
            OKCommand = new RelayCommand(() =>
              {
            PublishedCameraProfile profile = new PublishedCameraProfile(SelectedCamera.Id, SelectedCamera.Name)
            {
              CameraThumbnail = SelectedCamera.Thumbnail,
              DeviceServiceHostName = SelectedCamera.HostName,
              DeviceServiceUri = SelectedCamera.HostUri,
            };
            PublishedDestination destination = new PublishedDestination(DestinationPort);

            Status = ViewModelStatus.Saving;
            Model.PublishCamera(SelectedService.Uri.ToString(), profile, destination, PublishCameraCallback);
              });

              CancelCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.PublishMedia_CancelConfigCameraEvent));
              });

              CheckPortAvailableCommand = new RelayCommand(() =>
              {
            Status = ViewModelStatus.Loading;
            Model.CheckPortAvailable(SelectedService.Uri.ToString(), DestinationPort, CheckPortAvailableCallback);
              });
        }
        protected override void BindCommands()
        {
            base.BindCommands();

              SelectFileCommand = new RelayCommand(SelectFile);
        }
Beispiel #18
0
 protected override void UnbindCommands()
 {
     ColorSelectedCommand = null;
       CancelCommand = null;
       OKCommand = null;
 }
        protected override void BindCommands()
        {
            CreateCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.DeviceConfiguration_CreateCameraEvent));
              });

              UpdateCommand = new RelayCommand(() =>
              {
            if (SelectedCamera == null)
            {
              Messenger.Default.Send(new ViewModelMessageBoxMessage(this, LanguageString.Find("DeviceConfiguration_CameraManagementView_SelectTargetEditCamera"), ViewModelMessageBoxType.Error));
              return;
            }

            Messenger.Default.Send(new NotificationMessage<Camera>(UIMessageType.DeviceConfiguration_UpdateCameraEvent, SelectedCamera));
              });

              DeleteCommand = new RelayCommand(() =>
              {
            if (SelectedCamera == null)
            {
              Messenger.Default.Send(new ViewModelMessageBoxMessage(this, LanguageString.Find("DeviceConfiguration_CameraManagementView_SelectTargetDeleteCamera"), ViewModelMessageBoxType.Error));
              return;
            }

            Status = ViewModelStatus.Saving;
            Model.DeleteCamera(SelectedCamera, DeleteCameraCallback);
              });

              CancelCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.DeviceConfiguration_SelectServiceEvent));
              });

              RefreshCommand = new RelayCommand(() =>
              {
            Refresh();
              });
        }
Beispiel #20
0
 protected override void UnbindCommands()
 {
     WebsiteHyperlinkCommand = null;
 }
        protected override void BindCommands()
        {
            OKCommand = new RelayCommand(() =>
              {
            Camera camera = MakeCamera();
            if (camera != null)
            {
              Status = ViewModelStatus.Loading;
              Model.CheckCameraName(camera, CheckCameraNameCallback);

              // 异步顺序执行两个操作
              AsyncWorkerHandle<bool> handle = AsyncWorkerHelper.DoWork<bool>(
              delegate(object sender, DoWorkEventArgs e)
              {
                _syncWork.WaitOne(); // 等待上一个操作的完成

                if (CheckCameraNameResult == CheckNameExistedResultType.NotExisted)
                {
                  Status = ViewModelStatus.Saving;
                  Model.CreateCamera(camera, CreateCameraCallback);
                }
              });
            }
              });

              CancelCommand = new RelayCommand(() =>
              {
            Messenger.Default.Send(new NotificationMessage(UIMessageType.DeviceConfiguration_CancelCameraEvent));
              });

              CheckCameraNameCommand = new RelayCommand(() =>
              {
            Camera camera = MakeCheckedCamera();
            if (camera != null)
            {
              Status = ViewModelStatus.Loading;
              Model.CheckCameraName(camera, CheckCameraNameCallback);
            }
              });

              #region SelectVideoSourceCommand

              SelectVideoSourceCommand = new RelayCommand(() =>
              {
            if (this.SelectedVideoSourceDescription == null || string.IsNullOrEmpty(this.SelectedVideoSourceDescription.OriginalSourceString))
            {
              Messenger.Default.Send(new NotificationMessage<VideoSourceDescription>(
            UIMessageType.DeviceConfiguration_NavigateVideoSourceEvent, null));
            }
            else
            {
              switch (this.SelectedVideoSourceDescription.SourceType)
              {
            case VideoSourceType.Mock:
              break;
            case VideoSourceType.LocalCamera:
              Status = ViewModelStatus.Initializing;
              CameraFilterModel.GetCameraFilters(GetCameraFiltersCallback);
              break;
            case VideoSourceType.LocalAVIFile:
              Messenger.Default.Send(new NotificationMessage<VideoSourceDescription>(
                UIMessageType.DeviceConfiguration_UpdateLocalAVIFileVideoSourceEvent, this.SelectedVideoSourceDescription));
              break;
            case VideoSourceType.LocalDesktop:
              Status = ViewModelStatus.Initializing;
              DesktopFilterModel.GetDesktopFilters(GetDesktopFiltersCallback);
              break;
            case VideoSourceType.NetworkJPEG:
              Messenger.Default.Send(new NotificationMessage<VideoSourceDescription>(
                UIMessageType.DeviceConfiguration_UpdateNetworkJPEGVideoSourceEvent, this.SelectedVideoSourceDescription));
              break;
            case VideoSourceType.NetworkMJPEG:
              Messenger.Default.Send(new NotificationMessage<VideoSourceDescription>(
                UIMessageType.DeviceConfiguration_UpdateNetworkMJPEGVideoSourceEvent, this.SelectedVideoSourceDescription));
              break;
            default:
              throw new NotSupportedException();
              }
            }
              });

              #endregion
        }