Method GetAddon
| Improve this Doc View SourceGetAddon<T>(AddonBag)
Get the single or default addon in the AddonBag by type.
Declaration
public static T GetAddon<T>(this AddonBag addonBag)
where T : class, IAddon
Parameters
Type | Name | Description |
---|---|---|
AddonBag | addonBag | The AddonBag. |
Returns
Type | Description |
---|---|
T | The addon with specified type, null if no addon found. |
Type Parameters
Name | Description |
---|---|
T | The type of the addon. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | More than one addon of the specified type found. |
GetAddon(AddonBag, Object)
Gets the addon by key.
Declaration
public static IAddon GetAddon(this AddonBag addonBag, object key)
Parameters
Type | Name | Description |
---|---|---|
AddonBag | addonBag | The AddonBag. |
System.Object | key | The key which uniquely identifies the addon. |
Returns
Type | Description |
---|---|
IAddon | The addon with specified key. null if no addon with specified key found. |