Open sandboxFocus

Method TryGetExtension

TryGetExtension<T>(out T?)

Gets the object of a given type that a Metalama extension makes available to the current template, if there is one.

Declaration
public static bool TryGetExtension<T>(out T? extension) where T : class, IMetaExtension
Parameters
Type Name Description
T extension

The object of type T, or null when there is none.

Returns
Type Description
bool

true when the current template has an object of type T; otherwise false.

Type Parameters
Name Description
T

The type of the object.

See Also