Example #1
0
 /// <summary>
 ///     Adds the command to the supplied group (or groups).
 /// </summary>
 /// <param name = "additionalGroups">The group (or groups) to which to add the command.</param>
 public void AddToGroup(PCommandGroups additionalGroups)
 {
     _groups = _groups | additionalGroups;
 }
Example #2
0
 /// <summary>
 ///     Removes the command from the supplied group (or groups)
 /// </summary>
 /// <param name = "groups">The group (or groups) from which to remove the command.</param>
 public void RemoveFromGroup(PCommandGroups groups)
 {
     _groups = _groups ^ (_groups & groups);
 }
Example #3
0
 /// <summary>
 ///     Determines whether the command is a member of a particular group.
 /// </summary>
 /// <param name = "groups">The group (or groups) to test the command for.</param>
 /// <returns>True, if the command is a member of the supplied group (or all groups); false otherwise.</returns>
 public bool IsInGroup(PCommandGroups groups)
 {
     return (_groups & groups) == _groups;
     //If _groups contains groups, an AND operation won't alter it
 }