Example #1
0
        private MvxImageCache <UIImage> CreateCache(IMvxFileDownloadCache fileDownloadCache)
        {
            var configuration = _configuration ?? MvxDownloadCacheConfiguration.Default;
            var fileCache     = new MvxImageCache <UIImage>(fileDownloadCache, configuration.MaxInMemoryFiles, configuration.MaxInMemoryBytes, configuration.DisposeOnRemoveFromCache);

            return(fileCache);
        }
Example #2
0
 private MvxImageCache<UIImage> CreateCache()
 {
     var configuration = _configuration ?? MvxDownloadCacheConfiguration.Default;
     var fileDownloadCache = Mvx.Resolve<IMvxFileDownloadCache>();
     var fileCache = new MvxImageCache<UIImage>(fileDownloadCache, configuration.MaxInMemoryFiles, configuration.MaxInMemoryBytes, configuration.DisposeOnRemoveFromCache);
     return fileCache;
 }
Example #3
0
        private MvxImageCache<Bitmap> CreateCache(IMvxFileDownloadCache fileDownloadCache)
        {
            var configuration = _configuration ?? MvxDownloadCacheConfiguration.Default;


            var fileCache = new MvxImageCache<Bitmap>(fileDownloadCache, configuration.MaxInMemoryFiles, configuration.MaxInMemoryBytes, configuration.DisposeOnRemoveFromCache);
            return fileCache;
        }
Example #4
0
        private MvxImageCache <Bitmap> CreateCache()
        {
            var configuration = _configuration ?? MvxDownloadCacheConfiguration.Default;

            var fileDownloadCache = Mvx.Resolve <IMvxFileDownloadCache>();
            var fileCache         = new MvxImageCache <Bitmap>(fileDownloadCache, configuration.MaxInMemoryFiles, configuration.MaxInMemoryBytes, configuration.DisposeOnRemoveFromCache);

            return(fileCache);
        }
        protected virtual void InitialiseUIImageProviders()
        {
            this.RegisterServiceInstance <IMvxHttpFileDownloader>(new MvxHttpFileDownloader());

#warning Huge Magic numbers here
            var fileDownloadCache = new MvxFileDownloadCache("Pictures.MvvmCross", "../Library/Caches/Pictures.MvvmCross/", 500, TimeSpan.FromDays(3.0));
            var fileCache         = new MvxImageCache <UIImage>(fileDownloadCache, 30, 4000000);
            this.RegisterServiceInstance <IMvxImageCache <UIImage> >(fileCache);

            this.RegisterServiceInstance <IMvxLocalFileImageLoader <UIImage> >(new MvxTouchLocalFileImageLoader());
        }
Example #6
0
        private MvxImageCache<Texture2D> CreateCache()
        {
            var configuration = _configuration ?? MvxDownloadCacheConfiguration.Default;

            var fileDownloadCache = new MvxFileDownloadCache(configuration.CacheName,
                                                             configuration.CacheFolderPath,
                                                             configuration.MaxFiles,
                                                             configuration.MaxFileAge);
			var fileCache = new MvxImageCache<Texture2D>(fileDownloadCache, configuration.MaxInMemoryFiles, configuration.MaxInMemoryBytes);
            return fileCache;
        }
Example #7
0
        private MvxImageCache<UIImage> CreateCache()
        {
            var configuration = _configuration ?? MvxDownloadCacheConfiguration.Default;

            var fileDownloadCache = new MvxFileDownloadCache(configuration.CacheName,
                                                             configuration.CacheFolderPath,
                                                             configuration.MaxFiles,
                                                             configuration.MaxFileAge);
            var fileCache = new MvxImageCache<UIImage>(fileDownloadCache, configuration.MaxInMemoryFiles, configuration.MaxInMemoryBytes, configuration.DisposeOnRemoveFromCache);
            return fileCache;
        }
Example #8
0
        protected virtual void InitialiseBitmapImageProviders()
        {
            this.RegisterServiceInstance <IMvxHttpFileDownloader>(new MvxHttpFileDownloader());

            var fileDownloadCache = new MvxFileDownloadCache("_PicturesMvvmCross", "_Caches/Pictures.MvvmCross/", 500, TimeSpan.FromDays(3.0));
            var fileCache         = new MvxImageCache <Bitmap>(fileDownloadCache, 30, 4000000);

            this.RegisterServiceInstance <IMvxImageCache <Bitmap> >(fileCache);

            this.RegisterServiceInstance <IMvxLocalFileImageLoader <Bitmap> >(new MvxAndroidLocalFileImageLoader());
        }
Example #9
0
        private MvxImageCache <Bitmap> CreateCache()
        {
            var configuration = _configuration ?? MvxDownloadCacheConfiguration.Default;

            var fileDownloadCache = new MvxFileDownloadCache(configuration.CacheName,
                                                             configuration.CacheFolderPath,
                                                             configuration.MaxFiles,
                                                             configuration.MaxFileAge);
            var fileCache = new MvxImageCache <Bitmap>(fileDownloadCache, configuration.MaxInMemoryFiles, configuration.MaxInMemoryBytes, configuration.DisposeOnRemoveFromCache);

            return(fileCache);
        }
Example #10
0
        public static IMvxImageCache <UIImage> CreateImageCache(
            MvxDownloadCacheConfiguration config)
        {
            var fileDownloadCache = CreateFileDownloadCache(config);
            var fileCache         = new MvxImageCache <UIImage>(
                fileDownloadCache,
                config.MaxInMemoryFiles,
                config.MaxInMemoryBytes,
                false);

            return(fileCache);
        }
Example #11
0
        private MvxImageCache <Texture2D> CreateCache()
        {
            var configuration = _configuration ?? MvxDownloadCacheConfiguration.Default;

            var fileDownloadCache = new MvxFileDownloadCache(configuration.CacheName,
                                                             configuration.CacheFolderPath,
                                                             configuration.MaxFiles,
                                                             configuration.MaxFileAge);
            var fileCache = new MvxImageCache <Texture2D>(fileDownloadCache, configuration.MaxInMemoryFiles, configuration.MaxInMemoryBytes);

            return(fileCache);
        }
Example #12
0
        public void Load()
        {
            File.PluginLoader.Instance.EnsureLoaded();

            this.RegisterServiceInstance<IMvxHttpFileDownloader>(new MvxHttpFileDownloader());

#warning Huge Magic numbers here - what cache sizes should be used?
            var fileDownloadCache = new MvxFileDownloadCache("Pictures.MvvmCross",
                                                             "../Library/Caches/Pictures.MvvmCross/", 500,
                                                             TimeSpan.FromDays(3.0));
            var fileCache = new MvxImageCache<UIImage>(fileDownloadCache, 30, 4000000);
            this.RegisterServiceInstance<IMvxImageCache<UIImage>>(fileCache);

            this.RegisterServiceInstance<IMvxLocalFileImageLoader<UIImage>>(new MvxTouchLocalFileImageLoader());
        }
        public void Load()
        {
#warning One day I would like to decouple this implementation from the FileStore plugin
            File.PluginLoader.Instance.EnsureLoaded();

            Mvx.RegisterSingleton<IMvxHttpFileDownloader>(new MvxHttpFileDownloader());

#warning Huge Magic numbers here - what cache sizes should be used?
            var fileDownloadCache = new MvxFileDownloadCache("Pictures.MvvmCross",
                                                             "../Library/Caches/Pictures.MvvmCross/", 500,
                                                             TimeSpan.FromDays(3.0));
            var fileCache = new MvxImageCache<UIImage>(fileDownloadCache, 30, 4000000);
            Mvx.RegisterSingleton<IMvxImageCache<UIImage>>(fileCache);

            Mvx.RegisterType<IMvxImageHelper<UIImage>, MvxDynamicImageHelper<UIImage>>();
            Mvx.RegisterSingleton<IMvxLocalFileImageLoader<UIImage>>(new MvxTouchLocalFileImageLoader());
        }
Example #14
0
        public void Load()
        {
#warning One day I would like to decouple this implementation from the FileStore plugin
            File.PluginLoader.Instance.EnsureLoaded();

            Mvx.RegisterSingleton <IMvxHttpFileDownloader>(new MvxHttpFileDownloader());

#warning Huge Magic numbers here - what cache sizes should be used?
            var fileDownloadCache = new MvxFileDownloadCache("Pictures.MvvmCross",
                                                             "../Library/Caches/Pictures.MvvmCross/", 500,
                                                             TimeSpan.FromDays(3.0));
            var fileCache = new MvxImageCache <UIImage>(fileDownloadCache, 30, 4000000);
            Mvx.RegisterSingleton <IMvxImageCache <UIImage> >(fileCache);

            Mvx.RegisterType <IMvxImageHelper <UIImage>, MvxDynamicImageHelper <UIImage> >();
            Mvx.RegisterSingleton <IMvxLocalFileImageLoader <UIImage> >(new MvxTouchLocalFileImageLoader());
        }
Example #15
0
        public void Load()
        {
            File.PluginLoader.Instance.EnsureLoaded();

            this.RegisterServiceInstance<IMvxHttpFileDownloader>(new MvxHttpFileDownloader());

#warning Huge Magic numbers here - what cache sizes should be used?
            try
            {
                var fileDownloadCache = new MvxFileDownloadCache("_PicturesMvvmCross", "_Caches/Pictures.MvvmCross/",
                                                                 500, TimeSpan.FromDays(3.0));
                var fileCache = new MvxImageCache<Bitmap>(fileDownloadCache, 30, 4000000);
                this.RegisterServiceInstance<IMvxImageCache<Bitmap>>(fileCache);

                this.RegisterServiceInstance<IMvxLocalFileImageLoader<Bitmap>>(new MvxAndroidLocalFileImageLoader());
            }
            catch (Exception exception)
            {
                MvxTrace.Trace(MvxTraceLevel.Error, "Binding", "Exception {0}", exception.ToLongString());
                throw;
            }
        }
        public void Load()
        {
#warning One day I would like to decouple this implementation from the FileStore plugin
			File.PluginLoader.Instance.EnsureLoaded();

            Mvx.RegisterSingleton<IMvxHttpFileDownloader>(new MvxHttpFileDownloader());

#warning Huge Magic numbers here - what cache sizes should be used?
            try
            {
                var fileDownloadCache = new MvxFileDownloadCache("_PicturesMvvmCross", "_Caches/Pictures.MvvmCross/",
                                                                 500, TimeSpan.FromDays(3.0));
                var fileCache = new MvxImageCache<Bitmap>(fileDownloadCache, 30, 4000000);
                Mvx.RegisterSingleton<IMvxImageCache<Bitmap>>(fileCache);

                Mvx.RegisterType<IMvxImageHelper<Bitmap>, MvxDynamicImageHelper<Bitmap>>();
                Mvx.RegisterSingleton<IMvxLocalFileImageLoader<Bitmap>>(new MvxAndroidLocalFileImageLoader());
            }
            catch (Exception exception)
            {
                MvxTrace.Error( "Binding", "Exception {0}", exception.ToLongString());
                throw;
            }
        }
Example #17
0
        public void Load()
        {
#warning One day I would like to decouple this implementation from the FileStore plugin
            File.PluginLoader.Instance.EnsureLoaded();

            Mvx.RegisterSingleton <IMvxHttpFileDownloader>(new MvxHttpFileDownloader());

#warning Huge Magic numbers here - what cache sizes should be used?
            try
            {
                var fileDownloadCache = new MvxFileDownloadCache("_PicturesMvvmCross", "_Caches/Pictures.MvvmCross/",
                                                                 500, TimeSpan.FromDays(3.0));
                var fileCache = new MvxImageCache <Bitmap>(fileDownloadCache, 30, 4000000);
                Mvx.RegisterSingleton <IMvxImageCache <Bitmap> >(fileCache);

                Mvx.RegisterType <IMvxImageHelper <Bitmap>, MvxDynamicImageHelper <Bitmap> >();
                Mvx.RegisterSingleton <IMvxLocalFileImageLoader <Bitmap> >(new MvxAndroidLocalFileImageLoader());
            }
            catch (Exception exception)
            {
                MvxTrace.Error("Binding", "Exception {0}", exception.ToLongString());
                throw;
            }
        }