Пример #1
0
        public UpdateViewModel(
            ICompressedFileManager compressedFileManager,
            IDirectoryManager directoryManager,
            IFileManager fileManager,
            IProcessManager processManager,
            IVersionService versionService,
            IMessagePublisher messagePublisher)
        {
            this.compressedFileManager = compressedFileManager;
            this.directoryManager      = directoryManager;
            this.fileManager           = fileManager;
            this.processManager        = processManager;
            this.messagePublisher      = messagePublisher;

            // Setup update information
            this.latestVersion = versionService.LatestVersion;

            var latestReleaseInfo = versionService.GetLatestReleaseInfo();

            if (latestReleaseInfo == null)
            {
                return;
            }

            this.downloadUrl = latestReleaseInfo.DownloadUrl;
            this.Changes     = latestReleaseInfo.Changes;

            this.web.DownloadProgressChanged += WebDownloadProgressChanged;
            this.web.DownloadFileCompleted   += WebDownloadFileCompleted;

            this.ButtonsEnabled = true;
        }