예제 #1
0
        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);
        }
예제 #2
0
 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);
 }
예제 #3
0
        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();
        }