AdapterHelper.FindByFullName Method

Namespace
Kampute.DocToolkit.Metadata.Adapters
Assembly
  • Kampute.DocToolkit.dll

Definition

Finds the index of a type by full name using binary search.
public static T FindByFullName<T>(this IReadOnlyList<T> types, string fullName)
	where T : IType

Type Parameters

T
The type of types in the list.

Parameters

types IReadOnlyList<T>
The list of types, ordered by IType.FullName.
fullName string
The full name to search for.

Returns

T
The type with the specified full name, or null if not found.

Exceptions

ArgumentNullException
Thrown when types or fullName is null.

Remarks

This method uses binary search to efficiently locate a type in a sorted collection. The input collection must be ordered by type full name using ordinal string comparison; otherwise, results are undefined.