Class SubscriptionGlobalEventArgs
- Namespace
- Bannerlord.ButterLib.DelayedSubModule
- Assembly
- Bannerlord.ButterLib.dll
A container class for the arguments of the events, that are added to the MBSubModuleBase public and protected method calls.
public class SubscriptionGlobalEventArgs : EventArgs
- Inheritance
-
SubscriptionGlobalEventArgs
- Inherited Members
Remarks
These Events are injected via Harmony patching of the respective methods with HarmonyLib.HarmonyPatchType.Prefix and HarmonyLib.HarmonyPatchType.Postfix.
Constructors
SubscriptionGlobalEventArgs(Type, bool, SubscriptionType, string)
Initializes a new instance of the SubscriptionGlobalEventArgs class with the supplied values.
public SubscriptionGlobalEventArgs(Type type, bool isBase, SubscriptionType subscriptionType, string methodName)
Parameters
typeTypeThe type of submodule for which the method was called.
isBaseboolAn indicator that the underlying virtual implementation of the MBSubModuleBase method was called, not a derived class override.
subscriptionTypeSubscriptionTypeA type of the Harmony patch that was used to raise the event.
methodNamestringA method of the ArgumentException derived class that was used to raise the event.
Exceptions
- ArgumentException
Thrown when
typedoes not point to a subclass of the ArgumentOutOfRangeException.- ArgumentOutOfRangeException
Thrown when
subscriptionTypeis not a valid SubscriptionGlobalEventArgs enum.
Properties
IsBase
An indicator that the underlying virtual implementation of the MBSubModuleBase method was called, not a derived class override.
public bool IsBase { get; }
Property Value
- bool
true, if base MBSubModuleBase virtual method was called. SubscriptionType can only be a AfterMethod in that case.
false, if corresponding override method of the derived class specified in Type was called. SubscriptionType could be both BeforeMethod and AfterMethod in that case.
MethodName
A method of the MBSubModuleBase derived class that was used to raise the event.
public string MethodName { get; }
Property Value
- string
A string containing the name of the method.
SubscriptionType
A type of the Harmony patch that was used to raise the event.
public SubscriptionType SubscriptionType { get; }
Property Value
- SubscriptionType
BeforeMethod, when event is raised before the execution of the method; AfterMethod, when event is raised after the execution of the method.
Type
The type of submodule for which the method was called.
public Type Type { get; }
Property Value
- Type
Exact Type of the MBSubModuleBase derived class.
Methods
IsValid(Type, string, SubscriptionType)
public bool IsValid(Type type, string methodName, SubscriptionType subscriptionType)
Parameters
typeTypemethodNamestringsubscriptionTypeSubscriptionType
Returns
IsValid<T>(string, SubscriptionType)
public bool IsValid<T>(string methodName, SubscriptionType subscriptionType) where T : MBSubModuleBase
Parameters
methodNamestringsubscriptionTypeSubscriptionType
Returns
Type Parameters
T
This page was last modified at 02/06/2024 11:11:43 +02:00 (UTC).
Commit Message
Author: Vitalii Mikhailov
Commit: afe4722382576c1b56cdc1f621d23c975b59dfa5
Tabulation fix