Пример #1
0
        public IEnumerable <IRule> GetRules(Category category)
        {
            EnsureLoaded();
            if (!categorizedRules.ContainsKey(category))
            {
                throw new ArgumentOutOfRangeException("category",
                                                      category, AddinCatalog.GetString("Category '{0}' does not exist.", category));
            }

            return(categorizedRules [category]);
        }
Пример #2
0
 /// <summary>
 /// Performs analysis on specified project and reports violations to GUI.
 /// </summary>
 static void AnalyzeProject(DotNetProject project, double work)
 {
     current_project = project;
     try {
         IEnumerable <IViolation> violations = RunAnalyzers(current_project, work);
         ResultsReporter.ReportViolations(violations);
     } catch (CodeAnalysisException) {
         throw;
     } catch (Exception ex) {
         throw new CodeAnalysisException(AddinCatalog.GetString("Analysis failed because of unexpected error: {0}. Please, contact the plugin developers.", ex), ex);
     } finally {
         current_project = null;
     }
 }
Пример #3
0
        protected override void Update(CommandInfo info)
        {
            SolutionItem entry = IdeApp.ProjectOperations.CurrentSelectedItem as SolutionItem;

            if (entry == null)
            {
                info.Enabled = info.Visible = false;
                return;
            }

            info.Enabled = !(MainAnalyzer.IsBusy);
            info.Visible = MainAnalyzer.CanAnalyze(entry);
            info.Text    = AddinCatalog.GetString("Analyze {0}", entry.Name);
        }