Ejemplo n.º 1
0
        /// <summary>
        /// Gets the user.
        /// </summary>
        /// <returns></returns>
        internal async Task<MixpanelClient> GetMixpanelClient()
        {
            if (_client != null)
                return _client;

            _client = await MixpanelClient.GetCurrentClient();
            return _client;
        }
Ejemplo n.º 2
0
        public static async Task <MixpanelClient> GetCurrentClient()
        {
            if (_current != null)
            {
                return(_current);
            }

            _current = new MixpanelClient();
            await _current.TrySendLocalElements();

            return(_current);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the current Mixpanel client instance.
        /// </summary>
        /// <returns></returns>
        public static MixpanelClient GetCurrentClient()
        {
            if (_current != null)
            {
                return(_current);
            }

            _current = new MixpanelClient();
            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate
            {
                _current.TrySendLocalElements();
            }));
            return(_current);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets the current Mixpanel client instance.
        /// </summary>
        /// <returns></returns>
        public static MixpanelClient GetCurrentClient()
        {
            if (_current != null)
                return _current;

            _current = new MixpanelClient();
            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate
                {
                    _current.TrySendLocalElements();
                }));
            return _current;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Resets the current Mixpanel client to a specific instance.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <returns></returns>
 public static void ResetClient(MixpanelClient client)
 {
     _current = client;
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets the current Mixpanel client instance.
        /// </summary>
        /// <returns></returns>
        public static MixpanelClient GetCurrentClient(bool offlineEnabled = true)
        {
            if (_current != null) {
                _current._isOfflineEnabled = offlineEnabled;
                return _current;
            }

            _current = new MixpanelClient();
            _current._isOfflineEnabled = offlineEnabled;
            if (offlineEnabled) {
                ThreadPool.QueueUserWorkItem(new WaitCallback(delegate {
                        _current.TrySendLocalElements();
                    }));
            }
            return _current;
        }