private bool VsTelemetryIsOptedIn(GenShell genShell)
        {
            var info = genShell.GetVSTelemetryInfo();

            _client.Context.Properties.Add(TelemetryProperties.VisualStudioEdition, info.VisualStudioEdition);
            _client.Context.Properties.Add(TelemetryProperties.VisualStudioExeVersion, info.VisualStudioExeVersion);
            _client.Context.Properties.Add(TelemetryProperties.VisualStudioCulture, info.VisualStudioCulture);
            _client.Context.Properties.Add(TelemetryProperties.VisualStudioManifestId, info.VisualStudioManifestId);

            return(info.OptedIn);
        }
예제 #2
0
        public async System.Threading.Tasks.Task GenContextInitAsync(GenShell shell, string language)
        {
            if (GenContext.InitializedLanguage != language)
            {
#if DEBUG
                GenContext.Bootstrap(new LocalTemplatesSource(), shell, language);
#else
                GenContext.Bootstrap(new RemoteTemplatesSource(), shell, language);
#endif
                await GenContext.ToolBox.Repo.SynchronizeAsync();
            }
        }
        public void IntializeTelemetryClient(GenShell genShell)
        {
            if (_client != null)
            {
                return;
            }

            var config = TelemetryConfiguration.CreateDefault();

            try
            {
                config.InstrumentationKey = _currentConfig.RemoteTelemetryKey;

                var vstelemetryInfo = genShell.GetVSTelemetryInfo();
                if (vstelemetryInfo.OptedIn && RemoteKeyAvailable())
                {
                    if (!string.IsNullOrEmpty(_currentConfig.CustomTelemetryEndpoint))
                    {
                        config.TelemetryChannel.EndpointAddress = _currentConfig.CustomTelemetryEndpoint;
                    }

                    IsEnabled = true;
#if DEBUG
                    config.TelemetryChannel.DeveloperMode = true;
#endif
                }
                else
                {
                    IsEnabled = false;
                    config.DisableTelemetry = true;
                }

                _client = new TelemetryClient(config);
                SetSessionData();
                SetVSTelemetryInfo(vstelemetryInfo);

                _client.TrackEvent(TelemetryEvents.SessionStart);
            }
            catch (Exception ex)
            {
                IsEnabled = false;
                config.DisableTelemetry = true;

                Trace.TraceError($"Exception instantiating TelemetryClient:\n\r{ex}");
            }
        }
        public void IntializeTelemetryClient(GenShell genShell)
        {
            try
            {
                _client = new TelemetryClient()
                {
                    InstrumentationKey = _currentConfig.RemoteTelemetryKey,
                };

                if (VsTelemetryIsOptedIn(genShell) && RemoteKeyAvailable())
                {
                    if (!string.IsNullOrEmpty(_currentConfig.CustomTelemetryEndpoint))
                    {
                        TelemetryConfiguration.Active.TelemetryChannel.EndpointAddress = _currentConfig.CustomTelemetryEndpoint;
                    }

                    SetSessionData();

                    _client.TrackEvent(TelemetryEvents.SessionStart);

                    IsEnabled = true;
#if DEBUG
                    TelemetryConfiguration.Active.TelemetryChannel.DeveloperMode = true;
#endif
                }
                else
                {
                    IsEnabled = false;
                    TelemetryConfiguration.Active.DisableTelemetry = true;
                }
            }
            catch (Exception ex)
            {
                IsEnabled = false;
                TelemetryConfiguration.Active.DisableTelemetry = true;

                Trace.TraceError($"Exception instantiating TelemetryClient:\n\r{ex.ToString()}");
            }
        }
예제 #5
0
 public void IntializeTelemetryClient(GenShell shell)
 {
     TelemetryService.Current.IntializeTelemetryClient(shell);
     HealthWriters.Available.Add(TelemetryService.Current);
 }
 public ProjectConfigInfoService(GenShell shell)
 {
     _shell = shell;
 }
예제 #7
0
 public void IntializeTelemetryClient(GenShell shell)
 {
     TelemetryService.Current.IntializeTelemetryClient(shell);
 }
예제 #8
0
 public GenToolBox(TemplatesRepository repo, GenShell shell)
 {
     Repo  = repo;
     Shell = shell;
 }
예제 #9
0
 public ShellHealthWriter(GenShell shell)
 {
     _shell = shell;
 }
 public ShellHealthWriter(GenShell shell)
 {
     this.shell = shell;
 }