/// <summary> /// Specifies that current <see cref="CacheManager"/>'s items should be stored using a <see cref="IsolatedStorageBackingStore"/> instance. /// </summary> /// <param name="backingStoreName">The name of the <see cref="IsolatedStorageBackingStore"/> instance</param> /// <param name="context">Fluent interface extension point.</param> /// <seealso cref="IsolatedStorageBackingStore"/> /// <seealso cref="IsolatedStorageCacheStorageData"/> public static IStoreInIsolatedStorage StoreInIsolatedStorage(this ICachingConfigurationCacheManager context, string backingStoreName) { if (string.IsNullOrEmpty(backingStoreName)) { throw new ArgumentException(Resources.EmptyParameterName, "backingStoreName"); } return(new StoreInIsolatedStorageBuilder(context, backingStoreName)); }
protected override void Arrange() { ConfigurationSourceBuilder = new ConfigurationSourceBuilder(); CachingConfiguration = ConfigurationSourceBuilder.ConfigureCaching(); ConfigureCacheManager = CachingConfiguration.ForCacheManagerNamed(cacheManagerName); }
/// <summary> /// Specifies that current <see cref="CacheManager"/>'s items should be stored using a <see cref="DataBackingStore"/> instance. /// </summary> /// <param name="backingStoreName">The name of the <see cref="DataBackingStore"/> instance.</param> /// <param name="context">Fluent interface extension point.</param> /// <seealso cref="DataBackingStore"/> /// <seealso cref="DataCacheStorageData"/> public static IStoreInDatabase StoreCacheMangerItemsInDatabase(this ICachingConfigurationCacheManager context, string backingStoreName) { if (String.IsNullOrEmpty(backingStoreName)) { throw new ArgumentException(Resources.ExceptionStringNullOrEmpty, "backingStoreName"); } return(new StoreInDatabase(context, backingStoreName)); }
/// <summary> /// Creates an instance of <see cref="CacheManagerExtension"/> passing the current <see cref="CacheManager"/>'s fluent interface builder. /// </summary> /// <param name="context">The current <see cref="CacheManager"/>'s fluent interface builder.<br/> /// This interface must implement <see cref="ICachingConfigurationCacheManagerExtension"/>.</param> protected CacheManagerExtension(ICachingConfigurationCacheManager context) { contextExtension = context as ICachingConfigurationCacheManagerExtension; if (contextExtension == null) throw new ArgumentException( string.Format(CultureInfo.CurrentCulture, Resources.ExceptionParameterMustImplement, typeof(ICachingConfigurationCacheManagerExtension).FullName), "context"); }
protected override void Arrange() { ConfigurationSourceBuilder = new ConfigurationSourceBuilder(); CachingConfiguration = ConfigurationSourceBuilder.ConfigureCaching(); ConfigureCacheManager = CachingConfiguration.ForCacheManagerNamed(cacheManagerName); }
public StoreInDatabase(ICachingConfigurationCacheManager context, string backingStoreName) : base(context) { dataCacheStore = new DataCacheStorageData { Name = backingStoreName }; base.AddBackingStoreToCachingConfigurationAndCurrentCacheManager(dataCacheStore); }
public StoreInDatabase(ICachingConfigurationCacheManager context, string backingStoreName) : base(context) { dataCacheStore = new DataCacheStorageData { Name = backingStoreName }; base.AddBackingStoreToCachingConfigurationAndCurrentCacheManager(dataCacheStore); }
protected override void Arrange() { ConfigurationSourceBuilder = new ConfigurationSourceBuilder(); CachingConfiguration = ConfigurationSourceBuilder.ConfigureCaching(); ConfigureCacheManager = CachingConfiguration.ForCacheManagerNamed(cacheManagerName); EncryptUsing = ConfigureCacheManager.StoreInIsolatedStorage(cacheManagerStoreName).EncryptUsing; }
protected override void Arrange() { ConfigurationSourceBuilder = new ConfigurationSourceBuilder(); CachingConfiguration = ConfigurationSourceBuilder.ConfigureCaching(); ConfigureCacheManager = CachingConfiguration.ForCacheManagerNamed(cacheManagerName); EncryptUsing = ConfigureCacheManager.StoreInIsolatedStorage(cacheManagerStoreName).EncryptUsing; }
public StoreInIsolatedStorageBuilder(ICachingConfigurationCacheManager context, string backingStoreName) : base(context) { isolatedStorageData = new IsolatedStorageCacheStorageData { Name = backingStoreName }; base.AddBackingStoreToCachingConfigurationAndCurrentCacheManager(isolatedStorageData); }
public StoreInIsolatedStorageBuilder(ICachingConfigurationCacheManager context, string backingStoreName) : base(context) { isolatedStorageData = new IsolatedStorageCacheStorageData { Name = backingStoreName }; base.AddBackingStoreToCachingConfigurationAndCurrentCacheManager(isolatedStorageData); }
/// <summary> /// Creates an instance of <see cref="CacheManagerExtension"/> passing the current <see cref="CacheManager"/>'s fluent interface builder. /// </summary> /// <param name="context">The current <see cref="CacheManager"/>'s fluent interface builder.<br/> /// This interface must implement <see cref="ICachingConfigurationCacheManagerExtension"/>.</param> protected CacheManagerExtension(ICachingConfigurationCacheManager context) { contextExtension = context as ICachingConfigurationCacheManagerExtension; if (contextExtension == null) { throw new ArgumentException( string.Format(CultureInfo.CurrentCulture, Resources.ExceptionParameterMustImplement, typeof(ICachingConfigurationCacheManagerExtension).FullName), "context"); } }
public StoreInCustomStoreBuilder(ICachingConfigurationCacheManager context, string backingStoreName, Type customCacheStoreType, NameValueCollection attributes) : base(context) { customCacheStorageData = new CustomCacheStorageData { Name = backingStoreName, Type = customCacheStoreType }; customCacheStorageData.Attributes.Add(attributes); base.AddBackingStoreToCachingConfigurationAndCurrentCacheManager(customCacheStorageData); }
/// <summary> /// Specifies that current <see cref="CacheManager"/>'s items should be stored using a custom implementation of <see cref="IBackingStore"/>. /// </summary> /// <param name="context">Fluent interface extension point.</param> /// <param name="backingStoreName">The name of the <see cref="IBackingStore"/> instance.</param> /// <param name="customCacheStoreType">The implementation type of <see cref="IBackingStore"/> that should be used.</param> /// <param name="attributes">Attributes that should be passed to <paramref name="customCacheStoreType"/> when creating an instance.</param> /// <returns>Fluent interface to further configure the custom <see cref="IBackingStore"/> implementation.</returns> /// <seealso cref="CustomCacheStorageData"/> public static IStoreInCustomStore StoreInCustomStore(this ICachingConfigurationCacheManager context, string backingStoreName, Type customCacheStoreType, NameValueCollection attributes) { if (string.IsNullOrEmpty(backingStoreName)) { throw new ArgumentException(Resources.ExceptionStringNullOrEmpty); } if (customCacheStoreType == null) { throw new ArgumentNullException("customCacheStoreType"); } if (attributes == null) { throw new ArgumentNullException("attributes"); } if (!typeof(IBackingStore).IsAssignableFrom(customCacheStoreType)) { throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.ExceptionTypeMustImplementInterface, typeof(IBackingStore)), "customCacheStoreType"); } return(new StoreInCustomStoreBuilder(context, backingStoreName, customCacheStoreType, attributes)); }
protected override void Arrange() { base.Arrange(); ConfigureCacheManager = CachingConfiguration.ForCacheManagerNamed(cacheManagerName); }
protected override void Arrange() { base.Arrange(); ConfigureCacheManager = CachingConfiguration.ForCacheManagerNamed(cacheManagerName); }
/// <summary> /// Specifies that current <see cref="CacheManager"/>'s items should be stored using a custom implementation of <see cref="IBackingStore"/>. /// </summary> /// <param name="context">Fluent interface extension point.</param> /// <param name="backingStoreName">The name of the <see cref="IBackingStore"/> instance.</param> /// <param name="customCacheStoreType">The implementation type of <see cref="IBackingStore"/> that should be used.</param> /// <returns>Fluent interface to further configure the custom <see cref="IBackingStore"/> implementation.</returns> /// <seealso cref="CustomCacheStorageData"/> public static IStoreInCustomStore StoreInCustomStore(this ICachingConfigurationCacheManager context, string backingStoreName, Type customCacheStoreType) { return(StoreInCustomStore(context, backingStoreName, customCacheStoreType, new NameValueCollection())); }
/// <summary> /// Specifies that current <see cref="CacheManager"/>'s items should be stored using a custom implementation of <see cref="IBackingStore"/>. /// </summary> /// <typeparam name="TCustomCacheStorageType">The implementation type of <see cref="IBackingStore"/> that should be used.</typeparam> /// <param name="context">Fluent interface extension point.</param> /// <param name="backingStoreName">The name of the <see cref="IBackingStore"/> instance.</param> /// <param name="attributes">Attributes that should be passed to <typeparamref name="TCustomCacheStorageType"/> when creating an instance.</param> /// <returns>Fluent interface to further configure the custom <see cref="IBackingStore"/> implementation.</returns> /// <seealso cref="CustomCacheStorageData"/> public static IStoreInCustomStore StoreInCustomStore <TCustomCacheStorageType>(this ICachingConfigurationCacheManager context, string backingStoreName, NameValueCollection attributes) where TCustomCacheStorageType : IBackingStore { return(StoreInCustomStore(context, backingStoreName, typeof(TCustomCacheStorageType), attributes)); }