void backworkerFetchProjecs_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ResolveControlsStatus(false); if (OriginalJiraProjects != null) { foreach (var project in OriginalJiraProjects) { ForSelectedJiraProjects.Add(project); SearchSource.Add(project); } if (SelectedJiraProjects != null) { foreach (var project in SelectedJiraProjects) { var index = ForSelectedJiraProjects.FindIndex( p => p.Name.Equals(project.Name, StringComparison.InvariantCultureIgnoreCase)); if (index > -1) { ForSelectedJiraProjects.RemoveAt(index); SearchSource.RemoveAt(index); } } } } RebindingDataSource(); }
private void wmtxtSearchbox_TextChanged(object sender, EventArgs e) { if (String.IsNullOrWhiteSpace(wmtxtSearchbox.Text)) { ForSelectedJiraProjects.Clear(); if (SearchSource != null) { foreach (var project in SearchSource) { ForSelectedJiraProjects.Add(project); } } } else { var condition = SearchSource.Where(o => o.Name.ToLower().Contains(wmtxtSearchbox.Text.ToLower())).ToList(); ForSelectedJiraProjects = condition; } RebindingForSelectedDataSource(); }