private void ShowRecSugDialog(IEnumerable <ListViewItem> rows, HashSet <CkanModule> toInstall) { Util.Invoke(this, () => { RecommendedModsToggleCheckbox.Checked = true; tabController.RenameTab("ChooseRecommendedModsTabPage", Properties.Resources.MainRecommendationsTitle); RecommendedModsListView.Items.Clear(); RecommendedModsListView.Items.AddRange(rows.ToArray()); }); tabController.ShowTab("ChooseRecommendedModsTabPage", 3); tabController.SetTabLock(true); if (Platform.IsMono) { // Workaround: make sure the ListView headers are drawn RecommendedModsListView.EndUpdate(); } lock (this) { Monitor.Wait(this); } if (!installCanceled) { toInstall.UnionWith(GetSelected()); } tabController.SetTabLock(false); }
public HashSet <CkanModule> Wait() { if (Platform.IsMono) { // Workaround: make sure the ListView headers are drawn Util.Invoke(this, () => RecommendedModsListView.EndUpdate()); } task = new TaskCompletionSource <HashSet <CkanModule> >(); return(task.Task.Result); }
private void RecommendedModsToggleCheckbox_CheckedChanged(object sender, EventArgs e) { var state = ((CheckBox)sender).Checked; foreach (ListViewItem item in RecommendedModsListView.Items) { if (item.Checked != state) { item.Checked = state; } } RecommendedModsListView.Refresh(); }