Show / Hide Table of Contents

Class UserManager

The implementation for the User Manager.

Inheritance
System.Object
UserManager
Implements
IUserManager
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Phoenix.Users
Assembly: Phoenix.Plugin.Users.dll
Syntax
public class UserManager : IUserManager

Constructors

View Source

UserManager(IPhoenixLogger, IEventAggregator, ISettingsManager)

Initializes a new instance of the UserManager class.

Declaration
public UserManager(IPhoenixLogger logger, IEventAggregator eventAggregator, ISettingsManager settingsManager)
Parameters
Type Name Description
IPhoenixLogger logger

The logger.

IEventAggregator eventAggregator

The event aggregator.

ISettingsManager settingsManager

The settings manager.

Properties

View Source

Settings

Gets the user management settings.

Declaration
public UserManagementSettings Settings { get; }
Property Value
Type Description
UserManagementSettings

Methods

View Source

AddUserAsync(String, IDevice)

Adds a user to a device.

Declaration
public async Task<PhoenixUser> AddUserAsync(string email, IDevice device)
Parameters
Type Name Description
System.String email

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.

View Source

AddUserAsync(String, String, IDevice)

Adds a user to a device and signs user in with provided password.

Declaration
public async Task<PhoenixUser> AddUserAsync(string email, string password, IDevice device)
Parameters
Type Name Description
System.String email

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 task which will return the new PhoenixUser.

View Source

ClearDefaultSignedInUserAsync(IDevice)

Clears the default signed in user on specified device.

Declaration
public async 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

awaitable task

View Source

GetDefaultSignedInUserEmailAsync(IDevice)

Gets the default signed in user email.

Declaration
public async 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 email.

View Source

GetUserOfEmail(String, IDevice)

Gets a cached user based on email.

Declaration
public PhoenixUser GetUserOfEmail(string email, IDevice device)
Parameters
Type Name Description
System.String email

The email associated with the user.

IDevice device

The device to look for the user in.

Returns
Type Description
PhoenixUser

The user.

View Source

GetUsersAsync(IDevice)

Asynchronously gets a list of users from a device.

Declaration
public async 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 users.

Remarks

On first call users will be grabbed. Any further call will return the cached results. Call or to regenerated the list.

View Source

GetUsersOfEmail(String)

Gets a list of a specific user across devices all cached devices.

Declaration
public IEnumerable<PhoenixUser> GetUsersOfEmail(string email)
Parameters
Type Name Description
System.String email

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

, , or must first be called, otherwise it will return null.

View Source

RefreshDeviceAsync(IDevice)

Asynchronously refreshes a device.

Declaration
public async Task RefreshDeviceAsync(IDevice device)
Parameters
Type Name Description
IDevice device

The device to refresh.

Returns
Type Description
System.Threading.Tasks.Task

The task running.

View Source

RefreshDevicesAsync()

Asynchronously refreshes all previously added devices.

Declaration
public async Task RefreshDevicesAsync()
Returns
Type Description
System.Threading.Tasks.Task

The task running.

View Source

RemoveAllUsersAsync(IDevice)

Removes all users from an existing device.

Declaration
public async 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 executing the request.

Remarks

The device must have been initially added.

View Source

RemoveUserAsync(PhoenixUser)

Removes a user from a device.

Declaration
public async 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.

View Source

SignInAsync(PhoenixUser)

Signs the user in. It is assumed the password is stored on the device. Calling this method will raise the UserSignedInEvent Even though this method is supposed to not store the user's password, currently this option is ignored by the platform and the password is stored either way.

Declaration
public async 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.

View Source

SignOutAsync(PhoenixUser)

Signs the user out. Calling this method will raise the UserSignedOutEvent.

Declaration
public async 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.

Implements

IUserManager
  • View Source
In This Article
Back to top Generated by DocFX