public bool ValidateUsersList(bool bShowWarning)
 {
     // Make sure there are no blanks or duplicates in the list; remove them if there are.
     // If we get down to no items, disable the Next button.
     for (int i = UsersList.Count - 1; i >= 0; i--)
     {
         if (UsersList[i].Username.Length == 0)
         {
             UsersList.RemoveAt(i);
         }
         else if (isDuplicate(UsersList[i].Username, TYPE_USERNAME))
         {
             UsersList.RemoveAt(i);
         }
         else if (UsersList[i].MappedName.Length > 0)
         {
             if (isDuplicate(UsersList[i].MappedName, TYPE_MAPNAME))
             {
                 UsersList.RemoveAt(i);
             }
         }
     }
     if (UsersList.Count == 0)
     {
         if (bShowWarning)
         {
             MessageBox.Show("Please specify a source name", "Zimbra Migration", MessageBoxButton.OK,
                             MessageBoxImage.Warning);
         }
         EnableNext = false;
         return(false);
     }
     return(true);
 }
Exemple #2
0
 public void Delete()
 {
     UsersList.RemoveAt(index);
     FirstName    = "";
     LastName     = "";
     Email        = "";
     Tel          = "";
     Handtekening = "";
 }
        private void Remove()
        {
            UsersList.RemoveAt(CurrentUserSelection);
            EnableNext = (UsersList.Count > 0);

            ScheduleViewModel scheduleViewModel =
                ((ScheduleViewModel)ViewModelPtrs[(int)ViewType.SCHED]);

            scheduleViewModel.EnableMigrate = (scheduleViewModel.SchedList.Count > 0);
            scheduleViewModel.EnablePreview = scheduleViewModel.EnableMigrate;
        }
 private void RemoveUser(string username)
 {
     for (int i = 0; i < UsersList.Count; i++)
     {
         if (UsersList[i].Username.Equals(username))
         {
             UsersList.RemoveAt(i);
             break;
         }
     }
 }
Exemple #5
0
        private void Remove()
        {
            using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                UsersList.RemoveAt(CurrentUserSelection);
                EnableNext = (UsersList.Count > 0);

                ScheduleViewModel scheduleViewModel = ((ScheduleViewModel)ViewModelPtrs[(int)ViewType.SCHED]);
                scheduleViewModel.EnableMigrate = (scheduleViewModel.SchedList.Count > 0);
                scheduleViewModel.EnablePreview = scheduleViewModel.EnableMigrate;
            }
        }
        private void DeleteMethod(object param)
        {
            int index = 0;

            foreach (var user in UsersList)
            {
                if (user.Name == selectedUser.Name)
                {
                    UsersList.RemoveAt(index);
                    break;
                }
                ++index;
            }
            SelectedUser            = null;
            CanExecuteDeleteCommand = false;
            CanExecutePlay          = false;
            actions.SerializeUsers("User.xml", this);
        }
        private void Initialize()
        {
            int  cont  = 0;
            int  final = 0;
            bool found = false;

            foreach (UserModel user in UsersList)
            {
                if (user.UserName == UserLogged.UserName && found == false)
                {
                    found = true;
                    final = cont;
                }
                else
                {
                    cont++;
                }
            }
            UsersList.RemoveAt(final);
        }
Exemple #8
0
 public bool ValidateUsersList(bool bShowWarning)
 {
     using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
     {
         // Make sure there are no blanks or duplicates in the list; remove them if there are.
         // If we get down to no items, disable the Next button.
         for (int i = UsersList.Count - 1; i >= 0; i--)
         {
             if (UsersList[i].Username.Length == 0)
             {
                 UsersList.RemoveAt(i);
             }
             else if (isDuplicate(UsersList[i].Username, TYPE_USERNAME))
             {
                 UsersList.RemoveAt(i);
             }
             else if (UsersList[i].MappedName.Length > 0)
             {
                 if (isDuplicate(UsersList[i].MappedName, TYPE_MAPNAME))
                 {
                     UsersList.RemoveAt(i);
                 }
             }
         }
         if (UsersList.Count == 0)
         {
             if (bShowWarning)
             {
                 MessageBox.Show("Please specify a source name", "Zimbra Migration", MessageBoxButton.OK,
                                 MessageBoxImage.Warning);
             }
             EnableNext = false;
             return(false);
         }
     }
     return(true);
 }