コード例 #1
0
 internal MixpanelService(IMixpanelOptions options, IPropertiesProvider defaultPropertiesProvider, ITimeProvider timeProvider, IEventTracker eventTracker)
 {
     _defaultPropertiesProvider = defaultPropertiesProvider;
     _tracker      = eventTracker;
     _options      = options;
     _timeProvider = timeProvider;
 }
コード例 #2
0
        private static IEventTracker GetTracker(IMixpanelOptions options, IEnumerable <IHttpWebRequestStrategy> requestDecorators)
        {
            var mixpanelHttp = new MixpanelHttp(requestDecorators);

            return(new WsMixpanelTracker(options.Token, mixpanelHttp, new TrackerOptions()
            {
                SetEventTime = true, ProxyUrl = options.Url
            }));
        }
コード例 #3
0
        private static IEventTracker GetTracker(IMixpanelOptions options)
        {
            if (!options.Enabled)
            {
                return(new NullEventTracker());
            }

            var decoratorFactory = new RequestStrategyFactory
            {
                Timeout     = options.Timeout,
                Credentials = options.Credentials,
                Proxy       = options.Proxy,
                UserAgent   = options.UserAgent
            };

            return(GetTracker(options, decoratorFactory.GetStrategies()));
        }
コード例 #4
0
 internal MixpanelService(IMixpanelOptions options, IPropertiesProvider defaultPropertiesProvider, ITimeProvider timeProvider)
     : this(options, defaultPropertiesProvider, timeProvider, GetTracker(options))
 {
 }
コード例 #5
0
 public MixpanelService(IMixpanelOptions options, IPropertiesProvider defaultPropertiesProvider)
     : this(options, defaultPropertiesProvider, new Clock(), GetTracker(options))
 {
 }
コード例 #6
0
 public MixpanelService(IMixpanelOptions options)
     : this(options, new NullPropertiesProvider())
 {
 }