Table of Contents

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 DateTime

The timestamp to use for additions.

Properties

Count

The number of entries in the recency list.

public int Count { get; }

Property Value

int

Members

The members of the recency list.

public IEnumerable<UserIdentityRecencyList.Entry> Members { get; }

Property Value

IEnumerable<UserIdentityRecencyList.Entry>

Methods

Add(UserIdentity, DateTime)

Adds a user identity to the recency list.

public bool Add(UserIdentity identity, DateTime timestamp)

Parameters

identity UserIdentity

The user identity.

timestamp DateTime

The 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 UserIdentity

The user identity.

timestamp DateTime

The 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

bool

GetEnumerator()

public IEnumerator<UserIdentityRecencyList.Entry> GetEnumerator()

Returns

IEnumerator<UserIdentityRecencyList.Entry>

Remove(UserIdentity)

Remove a user identity from the recency list.

public bool Remove(UserIdentity identity)

Parameters

identity UserIdentity

The 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 UserIdentity
entry UserIdentityRecencyList.Entry

Returns

bool