BoolResult CanBuild(BuildContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } foreach (var type in UsedComponents) { BuildConfiguration.ValidateComponentTypeAndThrow(type); } return(OnCanBuild(context)); }
/// <summary> /// Determine if component is used by the build pipeline. /// Returns <see langword="false"/> if this build configuration does not have a build pipeline. /// </summary> /// <param name="type">The component type.</param> /// <returns><see langword="true"/> if the component is used by the build pipeline, <see langword="false"/> otherwise.</returns> public bool IsComponentUsed(Type type) { BuildConfiguration.ValidateComponentTypeAndThrow(type); return(UsedComponents.Any(usedComponent => usedComponent.IsAssignableFrom(type))); }