private void suppressProblem(object sender, MainToolWindowUI.SuppresssionRequestedEventArgs e) { if (e.Problem != null) e.Problem.Analyzer.suppressProblem(e.Problem, e.Scope); }
private void openProblemInEditor(object sender, MainToolWindowUI.OpenProblemInEditorEventArgs e) { Problem problem = e.Problem; IVsUIShellOpenDocument shellOpenDocument = (IVsUIShellOpenDocument)GetService(typeof(IVsUIShellOpenDocument)); Debug.Assert(shellOpenDocument != null); Guid guidCodeView = VSConstants.LOGVIEWID.Code_guid; Microsoft.VisualStudio.OLE.Interop.IServiceProvider sp = null; IVsUIHierarchy hierarchy = null; uint itemId = 0; IVsWindowFrame windowFrame = null; if (shellOpenDocument.OpenDocumentViaProject(problem.FilePath, ref guidCodeView, out sp, out hierarchy, out itemId, out windowFrame) != VSConstants.S_OK) { Debug.WriteLine("Error opening file " + problem.FilePath); return; } Debug.Assert(windowFrame != null); windowFrame.Show(); EnvDTE.DTE dte = (EnvDTE.DTE)GetService(typeof(SDTE)); Debug.Assert(dte != null); Debug.Assert(dte.ActiveDocument != null); var selection = (EnvDTE.TextSelection)dte.ActiveDocument.Selection; Debug.Assert(selection != null); selection.GotoLine(problem.Line > 0 ? problem.Line : 1); // Line cannot be 0 here }