/// <summary> /// Adds checkers and auditors defined in the specified assembly. /// </summary> /// <param name="assembly">The <see cref="Assembly"/> to look in.</param> private void AddCheckersAndAuditors(Assembly assembly) { // does the loaded assembly refer to this one? if it doesn't, there can't possibly be any of the classes we're looking for if (assembly.DoesAssemblyReferToAssembly(System.Reflection.Assembly.GetExecutingAssembly())) { // loop through all the types looking for types that are not abstract, inherit from StatusNode (directly or indirectly) and have a public empty constructor foreach (Type type in assembly.GetLoadableTypes()) { if (IsTestableStatusCheckerClass(type)) { // construct an instance (it will be added to the list by the constructor) StatusChecker checker = (StatusChecker)Activator.CreateInstance(type) !; AddCheckerOrAuditor(checker); } } } }
/// <summary> /// Constructs a StatusResultsBuilder with a set of baseline properties. /// <see cref="NatureOfSystem"/> start with a value of <see cref="StatusNatureOfSystem.ChildrenHeterogenous"/>. /// </summary> /// <param name="checker">The <see cref="StatusChecker"/> we are going to build results for.</param> /// <param name="baselineProperties">An enumeration of baseline <see cref="StatusProperty"/>s to initalize the property list with.</param> public StatusResultsBuilder(StatusChecker checker, IEnumerable <StatusProperty> baselineProperties) : this(checker) { _properties.AddRange(baselineProperties); }