Example #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;
        }
Example #2
0
        public static async Task <MixpanelClient> GetCurrentClient()
        {
            if (_current != null)
            {
                return(_current);
            }

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

            return(_current);
        }
Example #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);
        }
Example #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;
        }
Example #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;
 }
Example #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;
        }