Ejemplo n.º 1
0
        private void OnUpdateStateChanged(object sender, UpdateStateContract e)
        {
            var state = Map(e);

            OnUpdateStateChanged(state, _manualCheck);
            HandleManualCheck(state.Status);
            HandleUpdating(state.Status);
        }
Ejemplo n.º 2
0
        private UpdateState Map(UpdateStateContract e)
        {
            var releaseHistory = e.ReleaseHistory
                                 .Select(release => new Release(
                                             release.Version,
                                             release.EarlyAccess,
                                             release.New,
                                             release.ChangeLog.ToList()))
                                 .ToList();

            return(new UpdateState(releaseHistory, e.Available, e.Ready, (UpdateStatus)e.Status, e.FilePath, e.FileArguments));
        }
Ejemplo n.º 3
0
        private void _serviceClient_UpdateStateChanged(object sender, UpdateStateContract e)
        {
            if (_autoUpdateInProgress)
            {
                return;
            }

            if (AllowAutoUpdate(e.Status))
            {
                _serviceClient.StartUpdating(true);
                _autoUpdateInProgress = true;
                HandleUpdating(UpdateStatus.Updating);
                return;
            }

            var state = Map(e);

            OnUpdateStateChanged(state, _manualCheck);
            HandleManualCheck(state.Status);
            HandleUpdating(state.Status);
        }
Ejemplo n.º 4
0
        public void OnStateChanged(UpdateStateContract e)
        {
            Action action = () => UpdateStateChanged?.Invoke(this, e);

            Application.Current?.Dispatcher?.BeginInvoke(action, null);
        }