Class ConcurrentDeviceUserCollection
A collection for users of device using a ConcurrentDictionary.
Inheritance
Inherited Members
Namespace: Phoenix.Users
Assembly: Phoenix.Plugin.Users.dll
Syntax
public class ConcurrentDeviceUserCollection
Constructors
View SourceConcurrentDeviceUserCollection(IDevice)
Initializes a new instance of the ConcurrentDeviceUserCollection class.
Declaration
public ConcurrentDeviceUserCollection(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device associated with the container. |
Properties
View SourceCount
Gets the amount of users of the container.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Device
Gets the device associated with the container.
Declaration
public IDevice Device { get; }
Property Value
Type | Description |
---|---|
IDevice |
Emails
Gets all emails that serve as keys for each user.
Declaration
public ICollection<string> Emails { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.String> |
Item[String]
Tries to return a user by email.
Declaration
public PhoenixUser this[string email] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | The email associated with the user. |
Property Value
Type | Description |
---|---|
PhoenixUser | The PhoenixUser. |
Exceptions
Type | Condition |
---|---|
TryGetPhoenixUserFailedException | Thrown when a user can got be obtained. |
Users
Gets all users in this container.
Declaration
public ICollection<PhoenixUser> Users { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<PhoenixUser> |
Methods
View SourceAdd(String, PhoenixUser)
Tries to add an email and it's associated PhoenixUser to the container
Declaration
public bool Add(string email, PhoenixUser user)
Parameters
Type | Name | Description |
---|---|---|
System.String | The email of the user. |
|
PhoenixUser | user | The user |
Returns
Type | Description |
---|---|
System.Boolean | True if user was added successfully, false if not. |
Clear()
Clears all users associated with this container.
Declaration
public void Clear()
ContainsEmail(String)
Checks whether a user by email exists or not.
Declaration
public bool ContainsEmail(string email)
Parameters
Type | Name | Description |
---|---|---|
System.String | The email associated with the user. |
Returns
Type | Description |
---|---|
System.Boolean | True if the user exists, false if not. |
GetEnumerator()
Gets an enumerator for this container.
Declaration
public IEnumerator<KeyValuePair<string, PhoenixUser>> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, PhoenixUser>> | An enumerator for this container. |
Remove(String)
Tries to remove a user based on it's email from the container.
Declaration
public bool Remove(string email)
Parameters
Type | Name | Description |
---|---|---|
System.String | The email of the user. |
Returns
Type | Description |
---|---|
System.Boolean | True if user was removed successfully, false if not. |