Пример #1
0
        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);
        }
 public static void Validate(this IAppUpdateConfig config)
 {
     Ensure.NotNull(config.HttpClient, nameof(config.HttpClient));
     Ensure.NotNull(config.FeedUri, nameof(config.FeedUri));
     Ensure.NotEmpty(config.UpdatesPath, nameof(config.UpdatesPath));
     Ensure.NotNull(config.CurrentVersion, nameof(config.CurrentVersion));
 }
Пример #3
0
 public WebReleaseStorage(IAppUpdateConfig config)
 {
     _config = config;
 }