Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        private void UpdateUserList()
        {
            try
            {
                AutoFXUsers.Clear();
                AutoFXUsers = _helper.BuildUsersList();
                AutoFXUsers = AutoFXUsers.OrderBy(x => x.ID).ToList();
                AutoFXUsers.Reverse();

                FilteredUsersCollection.Clear();
                this._currentDispatcher.Invoke(DispatcherPriority.Normal, (Action)(() =>
                {
                    foreach (var user in AutoFXUsers)
                    {
                        this.FilteredUsersCollection.Add(user);
                    }
                    this.TotalClients = this.FilteredUsersCollection.Count;
                    _mailingHelper.UsersList = AutoFXUsers;
                }));
            }
            catch (Exception exception)
            {
                Logger.Error(exception, OType.FullName, "UpdateUserList");
            }
        }
        /// <summary>
        ///
        /// </summary>
        private void InitializeFilteredUsersCollection()
        {
            try
            {
                this.FilteredUsersCollection = new ObservableCollection <User>();
                AutoFXUsers = AutoFXUsers.OrderBy(x => x.ID).ToList();
                AutoFXUsers.Reverse();

                this._currentDispatcher.Invoke(DispatcherPriority.Normal, (Action)(() =>
                {
                    foreach (var user in AutoFXUsers)
                    {
                        this.FilteredUsersCollection.Add(user);
                    }
                }));
            }
            catch (Exception exception)
            {
                Logger.Error(exception, OType.FullName, "InitializeFilteredUsersCollection");
            }
        }
        /// <summary>
        ///
        /// </summary>
        public void RefreshUI()
        {
            try
            {
                this._currentDispatcher.Invoke(DispatcherPriority.Normal, (Action)(() =>
                {
                    AutoFXUsers = _helper.BuildUsersList();
                    AutoFXUsers = AutoFXUsers.OrderBy(x => x.ID).ToList();
                    AutoFXUsers.Reverse();

                    this.FilteredUsersCollection.Clear();

                    foreach (var user in AutoFXUsers)
                    {
                        this.FilteredUsersCollection.Add(user);
                    }
                    ResetTimer();
                }));
            }
            catch (Exception exception)
            {
                Logger.Error(exception, OType.FullName, "RefreshUI");
            }
        }