コード例 #1
0
        public PeopleEditorViewModel(StringBuilder log, string siteURL,Dispatcher d,string SearchString,ClientUtility.PrincipalType searchType)
         {                  
             PeopleEditorAgent = new PeopleEditorServiceAgent(siteURL,log);
             SearchCommand = new RelayCommand(SearchUserAction);
             SearchCommand.IsEnabled = true;
             OKCommand = new RelayCommand(OkAction);
             OKCommand.IsEnabled = true;
             SearchResults = new ObservableCollection<ClientUtility.PrincipalInfo>();
             SelectedResults = new ObservableCollection<ClientUtility.PrincipalInfo>();
             IsBusy = false;
             _dispatcher = d;
             _searchType = searchType;

             this.SearchString = SearchString;
             if (!string.IsNullOrEmpty(SearchString)) SearchCommand.Execute(null);
         }
コード例 #2
0
        public UserSecurityAdminViewModel(string siteURL,string siteSubURL, Dispatcher d,StringBuilder log,string adminGroup)
        {
            _log = log;
            _isBusy = false;
            SearchString = Constants.FILTER_USERS;
            
            
            CancelCommand = new RelayCommand(CancelAction);
            CancelCommand.IsEnabled = true;

            SearchCommand = new RelayCommand(SearchAction);
            SearchCommand.IsEnabled = true;
            SearchedUsers = new ObservableCollection<User>();
            SearchedGroups = new ObservableCollection<Group>();
            AllGroups = new ObservableCollection<Group>();

            UserGroupCommand = new RelayCommand(GetGroupsAction);
            UserGroupCommand.IsEnabled = false;
            UserGroups = new ObservableCollection<Group>();

            UpdateUserGroupsCommand = new RelayCommand(UpdateUserGroupsAction);
            UpdateUserGroupsCommand.IsEnabled = false;

            _dispatcher = d;    

            ChangeOwnerCommand = new RelayCommand(ChangeOwnerAction);    
            ChangeOwnerCommand.IsEnabled = true;
        
            NewGroupCommand = new RelayCommand(CreateNewGroupAction);
            NewGroupCommand.IsEnabled = true;

            EditGroupCommand = new RelayCommand(EditGroupAction);
            EditGroupCommand.IsEnabled = false;

            ViewAllPermissionsCommand = new RelayCommand(ViewAllPermissionAction);
            ViewAllPermissionsCommand.IsEnabled = false;

            GetGroupUsersCommand = new RelayCommand(GroupUsersAction);
            GetGroupUsersCommand.IsEnabled = false;
                    
            _siteURL = siteURL;
            UserGroupServiceAgent = new UserGroupServiceAgent( siteURL,siteSubURL,log);

            dialogService = new DialogService();
            dialogService.Width = 350;
            dialogService.Height = 120;

            ViewModelLocator vmlocator = new ViewModelLocator();
            object[] args = new object[] { this, _log, _dispatcher, adminGroup };
            GroupViewModel vm = (GroupViewModel)vmlocator.GetViewModel(typeof(GroupViewModel), true, args);
            InnerGroupViewModel = vm;
            InnerGroupViewModel.Visibility = false;

            object[] args1 = new object[] { this, _log, _dispatcher};
            ViewAllPermissionViewModel vm1 = (ViewAllPermissionViewModel)vmlocator.GetViewModel(typeof(ViewAllPermissionViewModel), true, args1);
            InnerPermissionViewModel = vm1;
            InnerPermissionViewModel.Visibility = false;

            object[] args2 = new object[] { this, _dispatcher };
            UserGroupsViewModel vm2 = (UserGroupsViewModel)vmlocator.GetViewModel(typeof(UserGroupsViewModel), true, args2);
            InnerUserGroupsViewModel = vm2;
            InnerUserGroupsViewModel.Visibility = false;

            GroupUsersViewModel vm3 = (GroupUsersViewModel)vmlocator.GetViewModel(typeof(GroupUsersViewModel), true, args2);
            InnerGroupUsersViewModel = vm3;
            InnerGroupUsersViewModel.Visibility = false;
          
            IsSearchByGroup = true;
            SearchCommand.Execute(null);

        }