Exemplo n.º 1
0
 public static void Init(DType type, IPlatformAdapter plat)
 {
     if (_instance == null)
     {
         _instance = new Device(type, plat);
     }
 }
Exemplo n.º 2
0
        LdClient(Configuration configuration, User user)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            Config = configuration;

            connectionLock = new SemaphoreSlim(1, 1);

            persister           = Factory.CreatePersister(configuration);
            deviceInfo          = Factory.CreateDeviceInfo(configuration);
            flagListenerManager = Factory.CreateFeatureFlagListenerManager(configuration);
            platformAdapter     = Factory.CreatePlatformAdapter(configuration);

            // If you pass in a user with a null or blank key, one will be assigned to them.
            if (String.IsNullOrEmpty(user.Key))
            {
                User = UserWithUniqueKey(user);
            }
            else
            {
                User = user;
            }

            flagCacheManager  = Factory.CreateFlagCacheManager(configuration, persister, flagListenerManager, User);
            connectionManager = Factory.CreateConnectionManager(configuration);
            updateProcessor   = Factory.CreateUpdateProcessor(configuration, User, flagCacheManager);
            eventProcessor    = Factory.CreateEventProcessor(configuration);

            eventProcessor.SendEvent(eventFactory.NewIdentifyEvent(User));

            SetupConnectionManager();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Specifies a component that provides special functionality for the current mobile platform.
 /// </summary>
 /// <param name="configuration">Configuration.</param>
 /// <param name="adapter">An implementation of <see cref="IPlatformAdapter"/>.</param>
 /// <returns>the same <c>Configuration</c> instance</returns>
 public static Configuration WithPlatformAdapter(this Configuration configuration, IPlatformAdapter adapter)
 {
     configuration.PlatformAdapter = adapter;
     return(configuration);
 }
Exemplo n.º 4
0
 PlatformAdapter()
 {
     concretePlatformAdapter = new Win32.Win32PlatformAdapter();
 }
Exemplo n.º 5
0
 private Device(DType type, IPlatformAdapter plat)
 {
     DeviceType = type;
     PlatData   = plat;
 }
Exemplo n.º 6
0
 private DataManager()
 {
     platData = Device.Instance.PlatData;
 }