public static void Bootstrap(TemplatesSource source, IGenShell shell, Version wizardVersion, string platform, string language) { try { AppHealth.Current.AddWriter(new ShellHealthWriter(shell)); AppHealth.Current.IntializeTelemetryClient(shell); AppHealth.Current.Info.TrackAsync($"{StringRes.ConfigurationFileLoadedString}: {Configuration.LoadedConfigFile}").FireAndForget(); string hostVersion = $"{shell.VisualStudio.GetVsVersionAndInstance()}-{wizardVersion.Major}.{wizardVersion.Minor}"; if (source is RemoteTemplatesSource) { CodeGen.Initialize($"{source.Id}.{source.Platform}.{source.Language}", hostVersion); } else { CodeGen.Initialize($"{source.Id}", hostVersion); } var repository = new TemplatesRepository(source, wizardVersion, platform, language); ToolBox = new GenToolBox(repository, shell); PurgeTempGenerations(Configuration.Current.DaysToKeepTempGenerations); CurrentLanguage = language; CurrentPlatform = platform; } catch (Exception ex) { AppHealth.Current.Exception.TrackAsync(ex, StringRes.GenContextBootstrapError).FireAndForget(); Trace.TraceError($"{StringRes.GenContextBootstrapError} Exception:\n\r{ex}"); throw; } }
public void IntializeTelemetryClient(IGenShell genShell) { if (_client != null) { return; } var config = TelemetryConfiguration.CreateDefault(); try { config.InstrumentationKey = _currentConfig.RemoteTelemetryKey; var vstelemetryInfo = genShell.Telemetry.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 GenToolBox(TemplatesRepository repo, IGenShell shell) { Repo = repo; Shell = shell; }
public ShellHealthWriter(IGenShell shell) { _shell = shell; }
public void IntializeTelemetryClient(IGenShell shell) { TelemetryService.Current.IntializeTelemetryClient(shell); HealthWriters.Available.Add(TelemetryService.Current); }
public ProjectConfigInfoService(IGenShell shell) { _shell = shell; }
public static void Bootstrap(TemplatesSource source, IGenShell shell, string platform, string language) { Bootstrap(source, shell, GetWizardVersionFromAssembly(), platform, language); }
public RightClickActions() { _shell = new VsGenShell(); }