internal void Execute(object sender, EventArgs e) { ThreadHelper.ThrowIfNotOnUIThread(); try { toolWindowService.Show(IssueVisualizationToolWindow.ToolWindowId); } catch (Exception ex) when(!ErrorHandler.IsCriticalException(ex)) { logger.WriteLine(string.Format(Resources.ERR_VisualizationToolWindow_Exception, ex)); } }
internal void ErrorListQueryStatus(object sender, EventArgs e) { try { if (monitorSelection.IsCmdUIContextActive(uiContextCookie, out var isActive) == VSConstants.S_OK) { ErrorListMenuItem.Visible = isActive == 1; } } catch (Exception ex) when(!ErrorHandler.IsCriticalException(ex)) { logger.WriteLine(string.Format(Resources.ERR_QueryStatusVisualizationToolWindowCommand, ex)); } }
public RulesSettings SafeLoad(string filePath) { RulesSettings settings = null; if (!fileSystem.File.Exists(filePath)) { logger?.WriteLine(CoreStrings.Settings_NoSettingsFile, filePath); } else { try { logger?.WriteLine(CoreStrings.Settings_LoadedSettingsFile, filePath); var data = fileSystem.File.ReadAllText(filePath); settings = JsonConvert.DeserializeObject <RulesSettings>(data); } catch (Exception ex) when(!ErrorHandler.IsCriticalException(ex)) { logger?.WriteLine(CoreStrings.Settings_ErrorLoadingSettingsFile, filePath, ex.Message); } } return(settings); }