Class XboxGamepadWrapper
The wrapper for the xbox gamepad to handle update queuing.
Inheritance
Implements
Inherited Members
Namespace: Phoenix.Devices
Assembly: Phoenix.Devices.Xbox.dll
Syntax
public class XboxGamepadWrapper : IDisposable
Constructors
View SourceXboxGamepadWrapper(ExtendedXboxDevice, String, IPhoenixLogger, Action<GamepadStatus>)
Initializes a new instance of the XboxGamepadWrapper class
Declaration
public XboxGamepadWrapper(ExtendedXboxDevice device, string consoleFriendlyName, IPhoenixLogger logger, Action<GamepadStatus> statusChangedCallback)
Parameters
Type | Name | Description |
---|---|---|
ExtendedXboxDevice | device | The console that the gamepad is for. |
System.String | consoleFriendlyName | The console's friendly name. |
IPhoenixLogger | logger | The logging manager. |
System.Action<GamepadStatus> | statusChangedCallback | The callback to call when the status changes. |
Fields
View SourceConnectDelayMS
How long to wait after connecting, as specified in the documentation.
Declaration
public const int ConnectDelayMS = 2000
Field Value
Type | Description |
---|---|
System.Int32 |
ReconnectDelayMS
Re-connection delay on gamepads in bad state
Declaration
public const int ReconnectDelayMS = 3000
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
View SourceState
Gets or sets the gamepad state.
Declaration
public XboxGamepadState State { get; set; }
Property Value
Type | Description |
---|---|
XboxGamepadState |
Methods
View SourceDisconnect()
Disconnects the gamepad from the xbox.
Declaration
public void Disconnect()
Dispose()
Disconnect gamepad on dispose
Declaration
public void Dispose()
Dispose(Boolean)
Perform finalization
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Whether disposing managed resources |
NotifyStateChanged()
Notifies the gamepad that the state is updated so it pushes it to the xbox gamepad when the update is called.
Declaration
public void NotifyStateChanged()
PairWithUser(UserInfo, Boolean)
Pairs the gamepad with the user. User must be signed in to pair.
Declaration
public Task PairWithUser(UserInfo user, bool exclusive)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | the user to pair with the gamepad. |
System.Boolean | exclusive | Whether or not the pairing is exclusive (removes all other gamepads from the user) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | awaitable task |