/// <summary> /// Evaluates whether a candidate type is a provider type. /// </summary> /// <remarks> /// The default implementation simply tests if the candidate type /// is a qualified descendent of the TProv provider type. /// <para> /// Subclasses may add, or replace with, other conditions such as testing /// for the presence of a particular class-level custom attribute or /// testing for the presence of other features of the class definition /// such as a qualifying constructor signature. /// </para> /// </remarks> protected bool MatchProviderType(Type candidate) { return(MefExtensions.IsDescendentOf(candidate, typeof(TProv))); }
/// <summary> /// Evaluates whether a candidate type is a provider type. /// </summary> /// <remarks> /// The default implementation simply tests if the candidate type /// is a qualified descendent of the TExt provider type and is /// decorated with a custom attribute of type TAtt. /// </remarks> protected bool MatchProviderType(Type candidate) { return(MefExtensions.IsDescendentOf(candidate, typeof(TExt)) && candidate.GetTypeInfo().GetCustomAttribute <TAtt>() != null); }