Example #1
0
 public void Configure(IMvxPluginConfiguration configuration)
 {
     if (configuration != null && !(configuration is MvxDownloadCacheConfiguration))
     {
         throw new MvxException("You must use a MvxDownloadCacheConfiguration object for configuring the DownloadCache, but you supplied {0}", configuration.GetType().Name);
     }
     _configuration = (MvxDownloadCacheConfiguration)configuration;
 }
Example #2
0
 public void Configure(IMvxPluginConfiguration configuration)
 {
     if (configuration != null && !(configuration is MvxDownloadCacheConfiguration))
     {
         throw new MvxException("You must use a MvxDownloadCacheConfiguration object for configuring the DownloadCache, but you supplied {0}", configuration.GetType().Name);
     }
     _configuration = (MvxDownloadCacheConfiguration)configuration;
 }
Example #3
0
        protected override void InitializeLastChance()
        {
            base.InitializeLastChance();

            MvvmCross.Plugins.File.PluginLoader.Instance.EnsureLoaded();
            MvvmCross.Plugins.Json.PluginLoader.Instance.EnsureLoaded();

            var downdloadCacheConfig = new MvxDownloadCacheConfiguration();
            var fileDownloadCache = new CustomMvxFileDownloadCache(downdloadCacheConfig.CacheName, downdloadCacheConfig.CacheFolderPath, downdloadCacheConfig.MaxFiles, downdloadCacheConfig.MaxFileAge);

            Mvx.LazyConstructAndRegisterSingleton<IMvxFileDownloadCache>(() => fileDownloadCache);
            Mvx.LazyConstructAndRegisterSingleton<IDownloadCache>(() => fileDownloadCache);
        }