Пример #1
0
 public void Stop()
 {
     if (monitor != null)
     {
         monitor = null;
     }
 }
Пример #2
0
        private static void TryInitializeMonitor()
        {
            if (!ConfigurationManager.AppSettings.Keys.OfType <string>().Contains(AnalyticsProductKey))
            {
                return;
            }

            if (!isTrackingEnabled)
            {
                throw new InvalidOperationException("TryInitializeMonitor cannot be called when isTrackingEnabled is false. Set Instance.IsTrackingEnabled to true first.");
            }

            if (monitor != null)
            {
                return;
            }

            string productKey = ConfigurationManager.AppSettings[AnalyticsProductKey];

            if (!string.IsNullOrEmpty(productKey))
            {
                monitor = new GoogleAnalyticsMonitor(productKey, AppName, GetAppVersion());
            }
        }