示例#1
0
 public abstract IEnumerable <Checkup> Contribute(Manifest.Manifest manifest, SharedState sharedState);
示例#2
0
 public abstract Task <DiagnosticResult> Examine(SharedState history);
示例#3
0
 public virtual Task Implement(SharedState sharedState, System.Threading.CancellationToken cancellationToken)
 => Task.CompletedTask;
示例#4
0
 public virtual bool ShouldExamine(SharedState history)
 {
     return(true);
 }
        public static IEnumerable <Checkup> BuildCheckupGraph(Manifest.Manifest manifest, SharedState sharedState)
        {
            var checkups = new List <Checkup>();

            checkups.AddRange(registeredCheckups);

            foreach (var c in registeredCheckupContributors)
            {
                var contributed = c.Contribute(manifest, sharedState);
                if (contributed?.Any() ?? false)
                {
                    checkups.AddRange(contributed);
                }
            }

            var filtered   = checkups.Where(c => c.IsPlatformSupported(Util.Platform));
            var checkupIds = filtered.Select(c => c.Id);

            var sorted = TopologicalSort <Checkup>(filtered, c =>
                                                   filtered.Where(dc => c.DeclareDependencies(checkupIds).Any(d => dc.IsPlatformSupported(Util.Platform) &&
                                                                                                              d.CheckupId.StartsWith(dc.Id, StringComparison.OrdinalIgnoreCase))));

            return(sorted);
        }