17 using System.Collections.Generic;
51 [DebuggerDisplay(
"{Name} ({ID}) {Status}")]
52 public sealed
class AcPrincipal : IEquatable<AcPrincipal>, IComparable<AcPrincipal>, IComparable
54 #region Class variables
58 private SortedSet<string> _members;
68 #region Equality comparison
79 if (ReferenceEquals(other, null))
return false;
80 if (ReferenceEquals(
this, other))
return true;
81 return ID == other.
ID;
88 public override bool Equals(
object other)
90 if (ReferenceEquals(other, null))
return false;
91 if (ReferenceEquals(
this, other))
return true;
92 if (GetType() != other.GetType())
return false;
107 #region Order comparison
121 result = String.Compare(
Name, other.
Name);
131 int IComparable.CompareTo(
object other)
134 throw new ArgumentException(
"Argument is not an AcPrincipal",
"other");
147 internal set { _id = value; }
155 get {
return _name ?? String.Empty; }
156 internal set { _name = value; }
164 get {
return _status; }
165 internal set { _status = value; }
176 public SortedSet<string>
Members
178 get {
return _members; }
179 internal set { _members = value; }
override bool Equals(object other)
Overridden to determine equality.
int ID
AccuRev principal ID number for the user or group.
AcPrincipal()
Constructor used during AcUsers and AcGroups list construction. It is called internally and not by us...
override int GetHashCode()
Override appropriate for type AcPrincipal.
PrinStatus
Whether the principal is active or inactive in AccuRev.
Contains the AccuRev principal attributes name, ID and status (active or inactive) for users and grou...
int CompareTo(AcPrincipal other)
Generic IComparable implementation (default) for comparing AcPrincipal objects to sort by AccuRev pri...
string Name
AccuRev principal name for the user or group.
SortedSet< string > Members
The list of groups a user has membership in, or the list of principals (users and groups) in a group...
override string ToString()
Returns the AccuRev principal name.
bool Equals(AcPrincipal other)
IEquatable implementation to determine the equality of instances of type AcPrincipal. Uses the AccuRev principal ID number to compare instances.
PrinStatus Status
Whether the principal is active or inactive in AccuRev.