TypeOverlap

References
public sealed class TypeOverlap
Utility class for figuring out what base classes and interfaces a collection of types have in common.

Constructors

TypeOverlap

#
public TypeOverlap(Type initial)
Create a new resolver based on a specific type.
initial (Type)Initial type.

Properties

CommonInterfaceCount

#
public int CommonInterfaceCount { get; }
Gets the number of interfaces shared by all resolved types.

CommonInterfaces

#
public IEnumerable<Type> CommonInterfaces { get; }
Enumerate over all interfaces that all resolved types have in common.

CommonType

#
public Type CommonType { get; }
Gets the most-derived type still compatible with all resolved types.

Methods

DetermineOverlap

#
public static Type DetermineOverlap(IEnumerable collection, Type initialConstraint = null)
Determine the type shared amongst all values in a collection.
collection (IEnumerable)Value.
initialConstraint (Type = null)Optional initial type.
Type shared amongst all values, or null if there are no values.

Include

#
public Overlap Include(Type type)
Resolve an additional type.
type (Type)Type to resolve.
True if the resolution state of this instance was modified.

ToString

#
public override string ToString()
Returns a string that represents the current object.
A string that represents the current object.
Object.ToString

Convertors

OperationResultDescription
implicitTypeTypeOverlap