示例#1
0
        public ProgressDialog(AutoUpdate autoUpdate, PendingUpdate update)
        {
            InitializeComponent();

            _autoUpdate = autoUpdate;
            _update     = update;

            Loaded += delegate
            {
                Action <double> downloadProgress = (value) =>
                {
                    Dispatcher.BeginInvoke(new Action(() =>
                    {
                        DownloadProgressBar.Value = value;
                    }));
                };

                Action installerStarted = () =>
                {
                    App.Current.Shutdown();
                };

                _autoUpdate.InstallPendingUpdate(_update as PendingUpdate, downloadProgress, installerStarted);
            };
        }
示例#2
0
    static bool StableOrWithPreRelease(PendingUpdate update)
    {
        if (update.IsDeprecated)
        {
            return(false);
        }
        var resolvedIsStable = !update.Resolved.Contains('-');
        var latestIsStable   = !update.Latest.Contains('-');

        return(!resolvedIsStable || latestIsStable);
    }