Class UserIdentityRecencyList
- Namespace
- MarymoorStudios.Core.Rpc.Identity
- Assembly
- MarymoorStudios.Core.Rpc.Identity.dll
A set of UserIdentity that keeps track of accesses.
public sealed class UserIdentityRecencyList : IEnumerable<UserIdentityRecencyList.Entry>, IEnumerable
- Inheritance
-
UserIdentityRecencyList
- Implements
- Inherited Members
Constructors
UserIdentityRecencyList()
Create an empty recency list.
public UserIdentityRecencyList()
UserIdentityRecencyList(IEnumerable<UserIdentity>, DateTime)
Create a recency list prepopulated with a set of initial members.
public UserIdentityRecencyList(IEnumerable<UserIdentity> members, DateTime timestamp)
Parameters
members
IEnumerable<UserIdentity>The initial members.
timestamp
DateTimeThe timestamp to use for additions.
Properties
Count
The number of entries in the recency list.
public int Count { get; }
Property Value
Members
The members of the recency list.
public IEnumerable<UserIdentityRecencyList.Entry> Members { get; }
Property Value
Methods
Add(UserIdentity, DateTime)
Adds a user identity to the recency list.
public bool Add(UserIdentity identity, DateTime timestamp)
Parameters
identity
UserIdentityThe user identity.
timestamp
DateTimeThe timestamp to use for additions.
Returns
- bool
True if successfully added, false otherwise.
AddOrUpdate(UserIdentity, DateTime)
Adds or updates a user identity to the recency list.
public bool AddOrUpdate(UserIdentity identity, DateTime timestamp)
Parameters
identity
UserIdentityThe user identity.
timestamp
DateTimeThe timestamp to use for additions.
Returns
- bool
True if updated, false if added.
Contains(UserIdentity)
Returns true if the identity is a member of the recency list, false otherwise.
public bool Contains(UserIdentity identity)
Parameters
identity
UserIdentity
Returns
GetEnumerator()
public IEnumerator<UserIdentityRecencyList.Entry> GetEnumerator()
Returns
Remove(UserIdentity)
Remove a user identity from the recency list.
public bool Remove(UserIdentity identity)
Parameters
identity
UserIdentityThe user identity.
Returns
- bool
True if removed, false otherwise.
RemoveOldest()
Removes the oldest entry in the recency list.
public void RemoveOldest()
Remarks
This method is a no-op if the recency list is empty.
TryFind(UserIdentity, out Entry)
Returns true if the identity is a member of the recency list, false otherwise.
public bool TryFind(UserIdentity identity, out UserIdentityRecencyList.Entry entry)
Parameters
identity
UserIdentityentry
UserIdentityRecencyList.Entry