Empeld
Empeld plugin documentation.
pluginbase.Helpers.Attributes.HookAttribute Class Reference

Class that represents a hooked method with a given scope More...

Inheritance diagram for pluginbase.Helpers.Attributes.HookAttribute:
pluginbase.Helpers.Attributes.ScopeAttribute pluginbase.Objects.Syncable.Entity.Controllers.EntityHookAttribute

Public Member Functions

 HookAttribute (object hook)
 
 HookAttribute (object hookEnum, object scopeEnum)
 
bool IsHookedTo (Enum hook)
 
- Public Member Functions inherited from pluginbase.Helpers.Attributes.ScopeAttribute
 ScopeAttribute ()
 
 ScopeAttribute (object scopeEnum)
 
bool HasScope (Enum scope)
 
override string ToString ()
 

Additional Inherited Members

- Public Types inherited from pluginbase.Helpers.Attributes.ScopeAttribute
enum  Special { Special.Wildcard }
 
- Properties inherited from pluginbase.Helpers.Attributes.ScopeAttribute
Enum Scope [get, set]
 
bool IsFlags [get]
 
bool ScopeDefined [get]
 

Detailed Description

Class that represents a hooked method with a given scope

Attribute: AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = true)

Constructor & Destructor Documentation

◆ HookAttribute() [1/2]

pluginbase.Helpers.Attributes.HookAttribute.HookAttribute ( object  hook)
16  :base()
17  {
18  _hook = hook as Enum;
19  _flagged = _hook.IsFlags();
20  }

◆ HookAttribute() [2/2]

pluginbase.Helpers.Attributes.HookAttribute.HookAttribute ( object  hookEnum,
object  scopeEnum 
)
23  : base(scopeEnum)
24  {
25  _hook = hookEnum as Enum;
26  _flagged = _hook.IsFlags();
27  }

Member Function Documentation

◆ IsHookedTo()

bool pluginbase.Helpers.Attributes.HookAttribute.IsHookedTo ( Enum  hook)
30  {
31  if (_hook == null || hook == null)
32  return false;
33 
34  if (_flagged)
35  return _hook.HasFlag(hook);
36  return _hook.Equals(hook);
37  }

The documentation for this class was generated from the following file: