Interface IUserManager
The interface for the User Manager.
Namespace: Phoenix.Users
Assembly: Phoenix.Abstractions.Users.dll
Syntax
public interface IUserManager
Methods
View SourceAddUserAsync(String, IDevice)
Adds a user to a device.
Declaration
Task<PhoenixUser> AddUserAsync(string email, IDevice device)
Parameters
Type | Name | Description |
---|---|---|
System.String | The email associated with a user. |
|
IDevice | device | The device to add a user to. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PhoenixUser> | A System.Threading.Tasks.Task that returns the new PhoenixUser. |
AddUserAsync(String, String, IDevice)
Adds a user to a device and signs user in with provided password.
Declaration
Task<PhoenixUser> AddUserAsync(string email, string password, IDevice device)
Parameters
Type | Name | Description |
---|---|---|
System.String | The email associated with a user. |
|
System.String | password | The password to sign in the user. |
IDevice | device | The device to add a user to. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PhoenixUser> | A System.Threading.Tasks.Task that returns the new PhoenixUser. |
ClearDefaultSignedInUserAsync(IDevice)
Clears the default signed in user on specified device.
Declaration
Task ClearDefaultSignedInUserAsync(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device to clear the default signed in user. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task performing the request. |
GetDefaultSignedInUserEmailAsync(IDevice)
Gets the default signed in user on specified device.
Declaration
Task<string> GetDefaultSignedInUserEmailAsync(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device to get the default signed in user from. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | The default user email. |
GetUserOfEmail(String, IDevice)
Gets a cached user based on email.
Declaration
PhoenixUser GetUserOfEmail(string email, IDevice device)
Parameters
Type | Name | Description |
---|---|---|
System.String | The email associated with the user. |
|
IDevice | device | The device to look for the user in. |
Returns
Type | Description |
---|---|
PhoenixUser | The user. |
GetUsersAsync(IDevice)
Asynchronously gets a list of users from a device.
Declaration
Task<IEnumerable<PhoenixUser>> GetUsersAsync(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device to get users from. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<PhoenixUser>> | A list of devices. |
Remarks
On first call users will be grabbed. Any further call will return the cached results. Call RefreshDevicesAsync() or RefreshDeviceAsync(IDevice) to regenerated the list.
GetUsersOfEmail(String)
Gets a list of a specific user across devices all cached devices.
Declaration
IEnumerable<PhoenixUser> GetUsersOfEmail(string email)
Parameters
Type | Name | Description |
---|---|---|
System.String | The email associated with the user to search for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PhoenixUser> | List of the specified user per device the user was found in. |
Remarks
GetUsersAsync(IDevice), RefreshDevicesAsync(), or RefreshDeviceAsync(IDevice) must first be called, otherwise it will return null.
RefreshDeviceAsync(IDevice)
Asynchronously refreshes specified device.
Declaration
Task RefreshDeviceAsync(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task running. |
RefreshDevicesAsync()
Asynchronously refreshes all current devices.
Declaration
Task RefreshDevicesAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task running. |
RemoveAllUsersAsync(IDevice)
Removes all users from a device.
Declaration
Task RemoveAllUsersAsync(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device to remove all users from. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task performing the request. |
RemoveUserAsync(PhoenixUser)
Removes a user from a device.
Declaration
Task<bool> RemoveUserAsync(PhoenixUser user)
Parameters
Type | Name | Description |
---|---|---|
PhoenixUser | user | The user to remove. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | A task which will return true if the removal was successful, false otherwise. |
SignInAsync(PhoenixUser)
Signs the user in.
Declaration
Task<bool> SignInAsync(PhoenixUser user)
Parameters
Type | Name | Description |
---|---|---|
PhoenixUser | user | The user to sign in. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | A task which will return true if the sign in was successful, false otherwise. |
SignOutAsync(PhoenixUser)
Signs the user out.
Declaration
Task<bool> SignOutAsync(PhoenixUser user)
Parameters
Type | Name | Description |
---|---|---|
PhoenixUser | user | The user to sign out. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if sign out was successful, false otherwise. |