Example #1
0
        public void TransmitExtensionLoadedEvent(ExtensionLoadedAnalyticsEvent extensionLoadedAnalyticsEvent)
        {
            if (!_enableAnalyticsChecker.IsEnabled())
            {
                throw new InvalidOperationException("This method should not be called because analytics transmission is disabled.");
            }

            Console.WriteLine(extensionLoadedAnalyticsEvent.ToString());
        }
Example #2
0
        public void TransmitExtensionLoadedEvent(ExtensionLoadedAnalyticsEvent extensionLoadedAnalyticsEvent)
        {
            if (!_enableAnalyticsChecker.IsEnabled())
            {
                throw new InvalidOperationException("This method should not be called because analytics transmission is disabled.");
            }

            var appInsightsEvent = _appInsightsEventConverter.ConvertToAppInsightsEvent(extensionLoadedAnalyticsEvent);

            _telemetryClient.TrackEvent(appInsightsEvent);
            _telemetryClient.Flush();
        }
        public void TransmitExtensionLoadedEvent(string ide, string ideVersion, string extensionVersion)
        {
            try
            {
                if (!_enableAnalyticsChecker.IsEnabled())
                {
                    return;
                }

                var userUniqueId        = _userUniqueIdStore.Get();
                var logonAnalyticsEvent = new ExtensionLoadedAnalyticsEvent(DateTime.UtcNow, userUniqueId, ide, ideVersion, extensionVersion);
                _analyticsTransmitterSink.TransmitEvent(logonAnalyticsEvent);
            }
            catch (Exception)
            {
                // catch all exceptions since we do not want to break the whole extension simply because data transmission failed
            }
        }
        public void TransmitExtensionLoadedEvent(string extensionVersion)
        {
            try
            {
                if (!_enableAnalyticsChecker.IsEnabled())
                {
                    return;
                }

                var    userUniqueId     = _userUniqueIdStore.Get();
                string ideName          = _ideInformationStore.GetName();
                string ideVersion       = _ideInformationStore.GetVersion();
                var    targetFrameworks = _projectTargetFrameworksProvider.GetProjectTargetFrameworks();
                var    extensionLoadedAnalyticsEvent = new ExtensionLoadedAnalyticsEvent(DateTime.UtcNow, userUniqueId, ideName, ideVersion, extensionVersion, targetFrameworks);
                _analyticsTransmitterSink.TransmitExtensionLoadedEvent(extensionLoadedAnalyticsEvent);
            }
            catch (Exception)
            {
                // catch all exceptions since we do not want to break the whole extension simply because data transmission failed
            }
        }