예제 #1
0
 public static IEnumerable <IAnalysisFixAction> GetActions(Document doc, FixableResult result)
 {
     foreach (var fix in result.Fixes)
     {
         foreach (var handler in AnalysisExtensions.GetFixHandlers(fix.FixType))
         {
             foreach (var action in handler.GetFixes(doc, fix))
             {
                 yield return(action);
             }
         }
     }
 }
예제 #2
0
        public static IList <Result> Analyze <T> (T input, RuleTreeType treeType)
        {
            Debug.Assert(typeof(T) == AnalysisExtensions.GetType(treeType.Input));

            var tree = AnalysisExtensions.GetAnalysisTree(treeType);

            if (tree == null)
            {
                return(RuleTreeLeaf.Empty);
            }

            //force to analyze immediately by evaluating into a list
            return(tree.Analyze(input).ToList());
        }
예제 #3
0
        public static IEnumerable <Result> Analyze <T> (T input, RuleTreeType treeType, CancellationToken cancellationToken = default(CancellationToken))
        {
            Debug.Assert(typeof(T) == AnalysisExtensions.GetType(treeType.Input));

            var tree = AnalysisExtensions.GetAnalysisTree(treeType);

            if (tree == null)
            {
                return(RuleTreeLeaf.Empty);
            }

            //force to analyze immediately by evaluating into a list
            return(tree.Analyze(input, cancellationToken).ToList());
        }