Class PhoenixClientManager<TClient>
A client manager for Phoenix.
Inheritance
Implements
Inherited Members
Namespace: Phoenix.ClientManager
Assembly: Phoenix.ClientManager.dll
Syntax
public class PhoenixClientManager<TClient> : GenericClientManager<IDevice, TClient>, ICanConnect<IDevice>, IEnumerable<IDevice>, IEnumerable, IDisposable, IPhoenixClientManager<TClient>, IClientManager<IDevice, TClient>, IClientManager<IDevice>, ICanDisconnect<IDevice>, IHoldsBaggage<IDevice> where TClient : class, IGameConnect, IEquatable<TClient?>
Type Parameters
Name | Description |
---|---|
TClient | The type of the client used to connect to a game instance. |
Constructors
View SourcePhoenixClientManager(IPhoenixClientManagerAdapter<TClient>, EventSubscriber, IDeviceManager?, IEnumerable<IBaggageFactory<TClient>>?)
Initializes a new instance of the PhoenixClientManager<TClient> class.
Declaration
public PhoenixClientManager(IPhoenixClientManagerAdapter<TClient> adapter, EventSubscriber eventSubscriber, IDeviceManager? deviceManager = null, IEnumerable<IBaggageFactory<TClient>>? baggageFactories = null)
Parameters
Type | Name | Description |
---|---|---|
IPhoenixClientManagerAdapter<TClient> | adapter | The adapter. |
EventSubscriber | eventSubscriber | The event subscriber used to subscribe to device related events. |
IDeviceManager | deviceManager | The Phoenix device manager. |
IEnumerable<IBaggageFactory<TClient>> | baggageFactories | An enumeration of factories to create baggages and attach them to clients. |
Properties
View SourceConnectionStatus
Gets the Phoenix.Controls.GameConnection.GameConnectionStatus of the client on the current device.
Declaration
public GameConnectionStatus ConnectionStatus { get; }
Property Value
Type | Description |
---|---|
GameConnectionStatus |
Current
Gets the active client that is associated with the current device.
Declaration
public TClient? Current { get; }
Property Value
Type | Description |
---|---|
TClient |
CurrentDevice
Gets the current device selected by user. Null if no device is selected.
Declaration
public IDevice? CurrentDevice { get; }
Property Value
Type | Description |
---|---|
IDevice |
IsConnected
Gets a value indicating whether a client is connected to the current device or not.
Declaration
public bool IsConnected { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public override void Dispose()
Overrides
OnDeviceSelected(DeviceCollectionChangeInfo)
Handles device select event.
Declaration
protected virtual void OnDeviceSelected(DeviceCollectionChangeInfo e)
Parameters
Type | Name | Description |
---|---|---|
DeviceCollectionChangeInfo | e | The event arguments. |
Remarks
There is one known bug: If a user has multiple devices selected and unselects the client device, the current device will be set to null. This can be fixed by using IDeviceManager to fall back to any selected device.
OptionsFor(IDevice)
Gets the connection options for a specific device.
Declaration
public object OptionsFor(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device to get the options for. |
Returns
Type | Description |
---|---|
object | The connection options. |
SetOptionsFor(IDevice, object)
Sets the options for a given device.
Declaration
public void SetOptionsFor(IDevice device, object options)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device to set options for. |
object | options | The options to set. |
Events
View SourceOnCurrentClientChanged
Event triggered when the current active client changes.
Declaration
public event EventHandler? OnCurrentClientChanged
Event Type
Type | Description |
---|---|
EventHandler |