Class PriorityAttribute
Specifies command's priority.
Inheritance
Namespace: TehGM.Wolfringo.Commands
Assembly: Wolfringo.Commands.dll
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class PriorityAttribute : Attribute, IEquatable<PriorityAttribute>, IComparable<PriorityAttribute>
Remarks
Commands with higher priority value will run before commands with lower value.
Depending on on the command service used, only one command can run per message. In such case, out of matching commands, only the one with highest priority value will run.
This is the behaviour of command services included with Wolfringo library by default.
Command priority will be taken from PriorityAttribute present on the method. If the method doesn't have the attribute, it'll be taken from PriorityAttribute present on the handler type. If the handler type also doesn't specify the priority, default value of 0 will be used.
Constructors
| Improve this Doc View SourcePriorityAttribute(Int32)
Creates a new priority attribute.
Declaration
public PriorityAttribute(int priority)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | priority | Command's priority. |
Remarks
See PriorityAttribute for more information about command priorities.
Properties
| Improve this Doc View SourcePriority
Command's priority.
Declaration
public int Priority { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Remarks
See PriorityAttribute for more information about command priorities.
Methods
| Improve this Doc View SourceCompareTo(PriorityAttribute)
Specifies command's priority.
Declaration
public int CompareTo(PriorityAttribute other)
Parameters
| Type | Name | Description |
|---|---|---|
| PriorityAttribute | other |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Remarks
Commands with higher priority value will run before commands with lower value.
Depending on on the command service used, only one command can run per message. In such case, out of matching commands, only the one with highest priority value will run.
This is the behaviour of command services included with Wolfringo library by default.
Command priority will be taken from PriorityAttribute present on the method. If the method doesn't have the attribute, it'll be taken from PriorityAttribute present on the handler type. If the handler type also doesn't specify the priority, default value of 0 will be used.
Equals(Object)
Specifies command's priority.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Overrides
Remarks
Commands with higher priority value will run before commands with lower value.
Depending on on the command service used, only one command can run per message. In such case, out of matching commands, only the one with highest priority value will run.
This is the behaviour of command services included with Wolfringo library by default.
Command priority will be taken from PriorityAttribute present on the method. If the method doesn't have the attribute, it'll be taken from PriorityAttribute present on the handler type. If the handler type also doesn't specify the priority, default value of 0 will be used.
Equals(PriorityAttribute)
Specifies command's priority.
Declaration
public bool Equals(PriorityAttribute other)
Parameters
| Type | Name | Description |
|---|---|---|
| PriorityAttribute | other |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Commands with higher priority value will run before commands with lower value.
Depending on on the command service used, only one command can run per message. In such case, out of matching commands, only the one with highest priority value will run.
This is the behaviour of command services included with Wolfringo library by default.
Command priority will be taken from PriorityAttribute present on the method. If the method doesn't have the attribute, it'll be taken from PriorityAttribute present on the handler type. If the handler type also doesn't specify the priority, default value of 0 will be used.
GetHashCode()
Specifies command's priority.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
Remarks
Commands with higher priority value will run before commands with lower value.
Depending on on the command service used, only one command can run per message. In such case, out of matching commands, only the one with highest priority value will run.
This is the behaviour of command services included with Wolfringo library by default.
Command priority will be taken from PriorityAttribute present on the method. If the method doesn't have the attribute, it'll be taken from PriorityAttribute present on the handler type. If the handler type also doesn't specify the priority, default value of 0 will be used.
Operators
| Improve this Doc View SourceEquality(PriorityAttribute, PriorityAttribute)
Specifies command's priority.
Declaration
public static bool operator ==(PriorityAttribute left, PriorityAttribute right)
Parameters
| Type | Name | Description |
|---|---|---|
| PriorityAttribute | left | |
| PriorityAttribute | right |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Commands with higher priority value will run before commands with lower value.
Depending on on the command service used, only one command can run per message. In such case, out of matching commands, only the one with highest priority value will run.
This is the behaviour of command services included with Wolfringo library by default.
Command priority will be taken from PriorityAttribute present on the method. If the method doesn't have the attribute, it'll be taken from PriorityAttribute present on the handler type. If the handler type also doesn't specify the priority, default value of 0 will be used.
Inequality(PriorityAttribute, PriorityAttribute)
Specifies command's priority.
Declaration
public static bool operator !=(PriorityAttribute left, PriorityAttribute right)
Parameters
| Type | Name | Description |
|---|---|---|
| PriorityAttribute | left | |
| PriorityAttribute | right |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Commands with higher priority value will run before commands with lower value.
Depending on on the command service used, only one command can run per message. In such case, out of matching commands, only the one with highest priority value will run.
This is the behaviour of command services included with Wolfringo library by default.
Command priority will be taken from PriorityAttribute present on the method. If the method doesn't have the attribute, it'll be taken from PriorityAttribute present on the handler type. If the handler type also doesn't specify the priority, default value of 0 will be used.