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

Class that represents an abstract definition of a scope More...

Inheritance diagram for pluginbase.Helpers.Attributes.ScopeAttribute:
pluginbase.Helpers.Attributes.HookAttribute pluginbase.Objects.Input.InputAttribute pluginbase.Objects.Tasks.TaskAttribute pluginbase.Objects.Syncable.Entity.Controllers.EntityHookAttribute

Public Types

enum  Special { Special.Wildcard }
 

Public Member Functions

 ScopeAttribute ()
 
 ScopeAttribute (object scopeEnum)
 
bool HasScope (Enum scope)
 
override string ToString ()
 

Properties

Enum Scope [get, set]
 
bool IsFlags [get]
 
bool ScopeDefined [get]
 

Detailed Description

Class that represents an abstract definition of a scope

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

Member Enumeration Documentation

◆ Special

Enumerator
Wildcard 
14  {
15  Wildcard
16  }

Constructor & Destructor Documentation

◆ ScopeAttribute() [1/2]

pluginbase.Helpers.Attributes.ScopeAttribute.ScopeAttribute ( )
40  { }

◆ ScopeAttribute() [2/2]

pluginbase.Helpers.Attributes.ScopeAttribute.ScopeAttribute ( object  scopeEnum)
43  {
44  this.Scope = scopeEnum as Enum;
45  }
Enum Scope
Definition: ScopeAttribute.cs:21

Member Function Documentation

◆ HasScope()

bool pluginbase.Helpers.Attributes.ScopeAttribute.HasScope ( Enum  scope)
48  {
49  //If any scope is acceptable, hurray
50  if (scope != null && scope.Equals(Special.Wildcard))
51  return true;
52 
53  if (_scope == null)
54  return scope == null; //If we're null, and we're checking for null then TRUE
55  if (scope == null)
56  return false; //If we're not null, and checking for null, FALSE
57 
58  //If we're equal wildcard, apply to non-null checks (If we're checking for NULL scope, we don't apply)
59  if (_scope.Equals(Special.Wildcard))
60  return true;
61 
62  if (this.IsFlags)
63  return _scope.HasFlag(scope); //Else, HasFlag
64 
65  return _scope.Equals(scope);
66  }
Special
Definition: ScopeAttribute.cs:13
bool IsFlags
Definition: ScopeAttribute.cs:32

◆ ToString()

override string pluginbase.Helpers.Attributes.ScopeAttribute.ToString ( )
69  {
70  return _scope == null ? "Null" : _scope.ToString();
71  }

Property Documentation

◆ IsFlags

bool pluginbase.Helpers.Attributes.ScopeAttribute.IsFlags
get

◆ Scope

Enum pluginbase.Helpers.Attributes.ScopeAttribute.Scope
getset

◆ ScopeDefined

bool pluginbase.Helpers.Attributes.ScopeAttribute.ScopeDefined
get

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