Example #1
0
        private bool CanSecureCommandExecute(SecureCommandArgs args)
        {
            if (canExecute == null || canExecute.Invoke(args))
            {
                RoomWindowViewModel roomWindowVM = args.CommandOwner as RoomWindowViewModel;

                if (Me != null && roomWindowVM != null)
                {
                    int targetRoleId = roomWindowVM.SelectedUserVM == null ? BuiltIns.AllRole.Id : roomWindowVM.SelectedUserVM.RoleVM.Id;

                    switch (CommandType)
                    {
                    case BuiltIns.FrontendCommandType:
                    case BuiltIns.UserCommandType:
                        if (roomWindowVM.SelectedUserVM != null)
                        {
                            return(Me.HasCommand(roomWindowVM.RoomVM.Id, Id, targetRoleId));
                        }
                        break;

                    case BuiltIns.BackendCommandType:
                        return(false);

                    case BuiltIns.NormalCommandType:
                        return(true);
                    }
                }
            }
            return(false);
        }
Example #2
0
 private void SwitchUserCommandExecute(SecureCommandArgs args)
 {
     if (CanSwitchUserCommandExecute(args))
     {
         Messenger.Default.Send <EnumNotificationMessage <object, HallWindowAction> >(new EnumNotificationMessage <object, HallWindowAction>(HallWindowAction.SwitchUser));
     }
 }
        private void ConfigCommandExecute(SecureCommandArgs args)
        {
            if (args != null)
            {
                ConfigurationItemViewModel vm = null;
                ConfigType type = (ConfigType)args.Content;
                switch (type)
                {
                case ConfigType.Audio:
                    vm = new ConfigurationItemViewModel(ApplicationVM.ProfileVM.AudioConfigurationVM);
                    break;

                case ConfigType.Vedio:
                    vm = new ConfigurationItemViewModel(ApplicationVM.ProfileVM.VideoConfigurationVM);
                    break;

                case ConfigType.Personal:
                    break;

                default:
                    break;
                }
                if (vm != null)
                {
                    Messenger.Default.Send <EnumNotificationMessage <object, RoomWindowAction> >(new EnumNotificationMessage <object, RoomWindowAction>(RoomWindowAction.ShowConfigWindow, vm));
                }
            }
        }
 private void NewImageGroupCommandExecute(SecureCommandArgs args)
 {
     if (!string.IsNullOrEmpty(NewGroup))
     {
         ImageGroups.Add(NewGroup);
         SelectedImageGroup = NewGroup;
     }
 }
 private void SelectUserCommandExecute(SecureCommandArgs args)
 {
     if (CanSelectUserCommandExecute(args))
     {
         RoomWindowVM.SelectUser(this);
         ApplicationVM.RoomWindowVM.CallJavaScript("addMicAndChatUser", NickName, Id);
     }
 }
        public void ExecuteCommand(CommandViewModel commandVM, SecureCommandArgs args)
        {
            var act = GetCommandDelegate(commandVM);

            if (act != null)
            {
                act(args);
            }
        }
Example #7
0
 private void DeleteAllImageCommandExecute(SecureCommandArgs args)
 {
     for (int i = 0; i < Images.Count; i++)
     {
         orMapper.Delete(new Image {
             Id = Images[i].Id
         });
     }
     Images.Clear();
 }
 private void DeleteSelectedImageGroupCommandExecute(SecureCommandArgs args)
 {
     if (!string.IsNullOrEmpty(SelectedImageGroup))
     {
         orMapper.ExecuteCommand("delete from Image where [ImageGroup]='" + SelectedImageGroup + "'");
     }
     ImageGroups.Remove(SelectedImageGroup);
     Images.Clear();
     SelectedImageGroup = Text.Select;
 }
 private void SelectImageGroupCommandExecute(SecureCommandArgs args)
 {
     if (!string.IsNullOrEmpty(SelectedImageGroup) && SelectedImageGroup != Text.Select)
     {
         Images.Clear();
         var imgs = orMapper.Search <Image>("[ImageGroup]='" + SelectedImageGroup + "'");
         imgs.ForEach(img =>
         {
             Images.Add(new ImageViewModel {
                 Id = img.Id, Title = img.Name, ImageGroup = img.ImageGroup, TheImage = img.TheImage
             });
         });
     }
 }
Example #10
0
 private void SecureCommandExecute(SecureCommandArgs args)
 {
     if (CanSecureCommandExecute(args))
     {
         if (execute == null)
         {
             ApplicationVM.ExecuteCommand(this, args);
         }
         else
         {
             execute(args);
         }
     }
 }
Example #11
0
 private void DeleteSelectedImageCommandExecute(SecureCommandArgs args)
 {
     for (int i = 0; i < Images.Count;)
     {
         if (Images[i].IsSelected)
         {
             orMapper.Delete(new Image {
                 Id = Images[i].Id
             });
             Images.RemoveAt(i);
             continue;
         }
         i++;
     }
 }
        private void OnMicCommandExecute(SecureCommandArgs args)
        {
            if (args != null)
            {
                MicType micType = (MicType)args.Content;
                if (Me.MicStatus == MicStatusMessage.MicStatus_Off)
                {
                    RoomClient.OnMic(RoomVM.Id, micType, -1);
                }
                else
                {
                    switch (micType)
                    {
                    case MicType.Private:
                        PrivateMicUserVMs.Remove(Me);
                        break;

                    case MicType.Secret:
                        SecretMicUserVMs.Remove(Me);
                        break;

                    case MicType.Public:
                        switch (Me.MicIndex)
                        {
                        case 0:
                            FirstMicUserVM = null;
                            break;

                        case 1:
                            SecondMicUserVM = null;
                            break;

                        case 2:
                            ThirdMicUserVM = null;
                            break;
                        }
                        break;
                    }
                    RoomClient.DownMic(RoomVM.Id, micType, Me.MicIndex);
                    Me.DownMic();
                    updateMicImage(Me.Id, false);// update the local image manually as the downmic meesage will not be received by itself.
                }
            }
        }
Example #13
0
 private bool CanDeleteMusicCommandExecute(SecureCommandArgs args)
 {
     return(Musics.Where(r => r.IsSelected == true).ToList().Count > 0);
 }
 public bool CanCommandExecute(SecureCommandArgs args)
 {
     return(Me != null);
 }
        public void CommandExecute(SecureCommandArgs args)
        {
            ConfigurationItemViewModel civm = new ConfigurationItemViewModel(ApplicationVM.ProfileVM.PhotoSelectorVM);

            Messenger.Default.Send <EnumNotificationMessage <object, ConfigurationWindowAction> >(new EnumNotificationMessage <object, ConfigurationWindowAction>(ConfigurationWindowAction.ConfigurationStateChanged, civm));
        }
Example #16
0
 private bool CanCancelCommandExecute(SecureCommandArgs args)
 {
     return(CanCancel);
 }
Example #17
0
 private void CancelCommandExecute(SecureCommandArgs args)
 {
     ApplicationVM.ShutDown();
 }
 private void BroadcastCommandExecute(SecureCommandArgs args)
 {
     StartAudioRecording();
 }
 private void StopCommandExecute(SecureCommandArgs args)
 {
     StopAudioRecording();
     StopAllAudioPlaying();
     playAll = false;
 }
 private bool CanRecommendRoomCommandExecute(SecureCommandArgs args)
 {
     return(true);
 }
 private void RecommendRoomCommandExecute(SecureCommandArgs args)
 {
 }
 private void ReserveRoomCommandExecute(SecureCommandArgs args)
 {
 }
 private void RecordCommandExecute(SecureCommandArgs args)
 {
     Messenger.Default.Send <EnumNotificationMessage <object, RoomWindowAction> >(new EnumNotificationMessage <object, RoomWindowAction>(RoomWindowAction.RecordAudio));
 }
Example #24
0
 public void CommandExecute(SecureCommandArgs args)
 {
     Messenger.Default.Send <EnumNotificationMessage <object, ConfigurationWindowAction> >(new EnumNotificationMessage <object, ConfigurationWindowAction>(ConfigurationWindowAction.ConfigurationStateChanged, this));
 }
 private void PlayCommandExecute(SecureCommandArgs args)
 {
     playAll = true;
 }
Example #26
0
 private void UploadMusicCommandExecute(SecureCommandArgs args)
 {
     Messenger.Default.Send <EnumNotificationMessage <object, ManageMusicWindowAction> >(new EnumNotificationMessage <object, ManageMusicWindowAction>(ManageMusicWindowAction.UploadMusic));
 }
Example #27
0
 private bool CanUploadMusicCommandExecute(SecureCommandArgs args)
 {
     return(!worker.IsBusy);
 }
Example #28
0
 private bool CanSwitchUserCommandExecute(SecureCommandArgs args)
 {
     return(ApplicationVM.LocalCache.CurrentUserVM != null);
 }
Example #29
0
 public bool CanCommandExecute(SecureCommandArgs args)
 {
     return(ApplicationVM.LocalCache.CurrentUserVM != null);
 }
Example #30
0
 private void RefreshCommandExecute(SecureCommandArgs args)
 {
     Messenger.Default.Send <EnumNotificationMessage <object, ConfigurationWindowAction> >(new EnumNotificationMessage <object, ConfigurationWindowAction>(ConfigurationWindowAction.VideoRefresh));
 }