예제 #1
0
파일: AppUpdates.cs 프로젝트: vormz/win-app
        public AppUpdates(IAppUpdateConfig config, ILaunchableFile launchableFile)
        {
            Ensure.NotNull(config, nameof(config));

            config.Validate();

            _releaseStorage =
                new OrderedReleaseStorage(
                    new SafeReleaseStorage(
                        new WebReleaseStorage(config)));

            _updatesDirectory =
                new SafeUpdatesDirectory(
                    new UpdatesDirectory(config.UpdatesPath, config.CurrentVersion)
                    );

            _fileLocation = new FileLocation(_updatesDirectory.Path);

            _downloadable =
                new SafeDownloadableFile(
                    new DownloadableFile(config.HttpClient));

            _validatable =
                new SafeValidatableFile(
                    new CachingValidatableFile(
                        new ValidatableFile()));

            _launchable = new SafeLaunchableFile(launchableFile);
        }
예제 #2
0
 public SafeDownloadableFile(IDownloadableFile origin)
 {
     _origin = origin;
 }
예제 #3
0
 public static void PushToBrowser(IDownloadableFile file)
 {
     PushToBrowser(file.ContentType, file.DownloadAsFilename, file.GetContent());
 }
예제 #4
0
 public void TestInitialize()
 {
     _origin = Substitute.For <IDownloadableFile>();
 }