public static ModUpdateProgressDialog CreateUpdateDialog(params IUpdateSource[] updaters)
        {
            if (updaters == null || updaters.Length == 0)
            {
                throw new ArgumentException("Need at least one update source.", nameof(updaters));
            }

            var w = new ModUpdateProgressDialog();

            w._updaters = updaters;
            return(w);
        }
예제 #2
0
        public static ModUpdateProgressDialog CreateUpdateDialog(UpdateSourceBase[] updaters, string[] autoInstallGuids = null)
        {
            if (updaters == null || updaters.Length == 0)
            {
                throw new ArgumentException("Need at least one update source.", nameof(updaters));
            }

            var w = new ModUpdateProgressDialog();

            w._updaters         = updaters;
            w._autoInstallGuids = autoInstallGuids;
            return(w);
        }
예제 #3
0
        public static List <UpdateTask> ShowWindow(ModUpdateProgressDialog owner, List <UpdateTask> updateTasks)
        {
            try
            {
                using (var w = new ModUpdateSelectDialog())
                {
                    if (owner.Icon != null)
                    {
                        w.Icon = owner.Icon;
                    }
                    w.StartPosition = FormStartPosition.CenterParent;
                    w._updateTasks  = updateTasks.OrderBy(x => x.UpToDate).ThenBy(x => x.TaskName).ToList();
                    w.ShowDialog();

                    return(w._selectedItems);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Failed to get updates", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(null);
        }