/// <summary>
        /// Tracks a feature use.
        /// </summary>
        /// <param name="featureName">Name of the feature</param>
        /// <param name="activationMethod">Method used to 'activate' the feature (e.g. Menu, Toolbar, Shortcut, etc.)</param>
        /// <returns>Object that can be used to 'end' the feature use, if measuring time spans is desired.</returns>
        public static IAnalyticsMonitorTrackedFeature TrackFeature(string featureName, string activationMethod)
        {
            if (featureName == null)
            {
                throw new ArgumentNullException("featureName");
            }

            if (activationMethod != null)
            {
                LoggingService.Debug("Activated feature '" + featureName + "', activation=" + activationMethod);
            }
            else
            {
                LoggingService.Debug("Activated feature '" + featureName + "'");
            }

            IAnalyticsMonitor monitor = ServiceManager.Instance.GetService <IAnalyticsMonitor>();

            if (monitor != null)
            {
                return(monitor.TrackFeature(featureName, activationMethod) ?? DummyFeature.Instance);
            }
            else
            {
                return(DummyFeature.Instance);
            }
        }
Esempio n. 2
0
 public void MonitorTrackFeature(string options)
 {
     PerformMonitorAction(options, CurrentCommandCallbackId, "Monitor.TrackFeature", args =>
     {
         var featureName = args[0];
         _monitor.TrackFeature(featureName);
     });
 }