コード例 #1
0
ファイル: Factory.cs プロジェクト: fossabot/xamarin-client
 internal static IFlagCacheManager CreateFlagCacheManager(Configuration configuration,
                                                          ISimplePersistance persister,
                                                          IFlagListenerUpdater updater,
                                                          User user)
 {
     if (configuration.FlagCacheManager != null)
     {
         return(configuration.FlagCacheManager);
     }
     else
     {
         var inMemoryCache = new UserFlagInMemoryCache();
         var deviceCache   = new UserFlagDeviceCache(persister);
         return(new FlagCacheManager(inMemoryCache, deviceCache, updater, user));
     }
 }
コード例 #2
0
 internal static IFlagCacheManager CreateFlagCacheManager(Configuration configuration,
                                                          IPersistentStorage persister,
                                                          IFlagChangedEventManager flagChangedEventManager,
                                                          User user)
 {
     if (configuration._flagCacheManager != null)
     {
         return(configuration._flagCacheManager);
     }
     else
     {
         var inMemoryCache = new UserFlagInMemoryCache();
         var deviceCache   = configuration.PersistFlagValues ? new UserFlagDeviceCache(persister) as IUserFlagCache : new NullUserFlagCache();
         return(new FlagCacheManager(inMemoryCache, deviceCache, flagChangedEventManager, user));
     }
 }