Пример #1
0
        private void performFilterPosts()
        {
            buttonPostKeywordSearch.Invoke(new Action(() => buttonPostKeywordSearch.Enabled = false));
            FilterPostStrategy = PostStrategyFactory.CreatePostStrategy(comboBoxPosts.SelectedItem.ToString());

            foreach (Post post in m_LoggedInUser.WallPosts)
            {
                if (post.Type == Post.eType.status && !string.IsNullOrEmpty(post.Message))
                {
                    if (FilterPostStrategy.FilterPosts(post).ToLower().Contains(searchTextBox.Text.ToLower()))
                    {
                        dataGridViewPosts.Invoke(new Action(() => r_PostsAdapter.Add(new PostsAdapter(post))));
                    }
                }
            }

            dataGridViewPosts.Invoke(new Action(() => dataGridViewPosts.Refresh()));
            buttonPostKeywordSearch.Invoke(new Action(() => buttonPostKeywordSearch.Enabled = true));
        }