/// <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);
        }
예제 #3
0
 /// <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");
        }
예제 #5
0
        protected override void Arrange()
        {
            ConfigurationSourceBuilder = new ConfigurationSourceBuilder();

            CachingConfiguration = ConfigurationSourceBuilder.ConfigureCaching();

            ConfigureCacheManager = CachingConfiguration.ForCacheManagerNamed(cacheManagerName);
        }
예제 #6
0
            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);
            }
예제 #12
0
        /// <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");
            }
        }
예제 #13
0
            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);
            }
예제 #14
0
        /// <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);
        }
예제 #17
0
 /// <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()));
 }
예제 #18
0
 /// <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));
 }