private void SolutionEvents_OnAfterLoadProject(object sender, LoadProjectEventArgs e) { #pragma warning disable VSTHRD102 // Implement internal logic asynchronously ThreadHelper.JoinableTaskFactory.Run(async() => #pragma warning restore VSTHRD102 // Implement internal logic asynchronously { await this.JoinableTaskFactory.SwitchToMainThreadAsync(this.DisposalToken); try { e.RealHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out object projectObj); if (projectObj is EnvDTE.Project project) { var projName = project.Name; var projFile = project.FileName; // Get off the UI thread so don't lock UI await TaskScheduler.Default; await this.ReportOnProjectsAsync(new List <(string, string)> { (projName, projFile) }); } }
private void SolutionEvents_OnBeforeUnloadProject(object sender, LoadProjectEventArgs e) { Debug.WriteLine($"tr: BeforeUnloadProject(RealHierarchy='{e.RealHierarchy}', StubHierarchy='{e.StubHierarchy}')"); }