public async void LoadAsync(IServiceProvider serviceProvider) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); IsLoading = true; var uiHierarchy = VsShellUtilities.GetUIHierarchyWindow(serviceProvider, new Guid(ToolWindowGuids80.SolutionExplorer)); var uiHierarchy2 = uiHierarchy as IVsUIHierarchyWindow2; uiHierarchy2.GetCurrentSelection(out var hierarchy, out var itemId, out var multiSelect); hierarchy.GetGuidProperty((uint)VSConstants.VSITEMID.Root, (int)__VSHPROPID.VSHPROPID_ProjectIDGuid, out var projectId); hierarchy.GetProperty((uint)VSConstants.VSITEMID.Root, (int)__VSHPROPID.VSHPROPID_ProjectName, out var projectName); if (hierarchy != null) { ProjectId = projectId; VSProjectName = projectName.ToString(); var settings = SentryProjectOptions.LoadOptions(projectId); if (settings != null) { ServerUrl = settings.ServerUrl; SentryProject = settings.Project; SentryApiKey = settings.ApiKey; Organization = settings.Organization; } } IsLoading = false; }
public SentryConnection(Guid projectId, SentryProjectOptions options) { _options = options; ProjectId = projectId; if (_options != null) { ConfigureClient(); } }
public static SentryConnection GetCurrent(Guid projectId) { SentryConnection connection; if (!_projects.TryGetValue(projectId, out connection)) { connection = new SentryConnection(projectId, SentryProjectOptions.LoadOptions(projectId)); _projects[projectId] = connection; } return(connection); }