Configuration of CAB Isolated Storage without config file

Topics: Caching Application Block
Jun 10, 2008 at 3:42 PM
I'm trying to configure the Isolated Storage as code rather than using the app.config file. I'm using this code snippet I found on this forum:

                    DictionaryConfigurationSource internalConfigurationSource = new DictionaryConfigurationSource();
                    CacheManagerSettings settings = new CacheManagerSettings();
                    internalConfigurationSource.Add(CacheManagerSettings.SectionName, settings);
                    CacheStorageData storageConfig = new CacheStorageData("Null Storage", typeof(NullBackingStore));
                    settings.BackingStores.Add(storageConfig);
                    CacheManagerData cacheManagerConfig = new CacheManagerData("CustomCache", 60, 1000, 10, storageConfig.Name);
                    settings.CacheManagers.Add(cacheManagerConfig);
                    settings.DefaultCacheManager = cacheManagerConfig.Name;
                    CacheManagerFactory cacheFactory = new CacheManagerFactory(internalConfigurationSource);
                    m_oCacheManager = cacheFactory.CreateDefault();

But how can I change it to use the Isolated Storage? I've tried already to use

                    new CacheStorageData("Isolated Storage", typeof(IsolatedStorageBackingStore)

But I'm getting an exception there. Any hints what am I doing wrong?
Jun 11, 2008 at 9:33 PM
Use IsolatedStorageCacheStorageData instead of CacheStorageData

Fernando


aroeder wrote:
I'm trying to configure the Isolated Storage as code rather than using the app.config file. I'm using this code snippet I found on this forum:

                    DictionaryConfigurationSource internalConfigurationSource = new DictionaryConfigurationSource();
                    CacheManagerSettings settings = new CacheManagerSettings();
                    internalConfigurationSource.Add(CacheManagerSettings.SectionName, settings);
                    CacheStorageData storageConfig = new CacheStorageData("Null Storage", typeof(NullBackingStore));
                    settings.BackingStores.Add(storageConfig);
                    CacheManagerData cacheManagerConfig = new CacheManagerData("CustomCache", 60, 1000, 10, storageConfig.Name);
                    settings.CacheManagers.Add(cacheManagerConfig);
                    settings.DefaultCacheManager = cacheManagerConfig.Name;
                    CacheManagerFactory cacheFactory = new CacheManagerFactory(internalConfigurationSource);
                    m_oCacheManager = cacheFactory.CreateDefault();

But how can I change it to use the Isolated Storage? I've tried already to use

                    new CacheStorageData("Isolated Storage", typeof(IsolatedStorageBackingStore)

But I'm getting an exception there. Any hints what am I doing wrong?



Jul 28, 2008 at 12:16 AM
How can I configured the CAB with SQL CE as Backing Store with out config file. Could anybody please help me understand how to do this?