Show / Hide Table of Contents

Class WindowsPC

The WindowsPC implementation for the deployment of packages

Inheritance
System.Object
CapabilityBase
DeviceBase
WindowsPC
Implements
System.IServiceProvider
IDevice
ICapability
IDeviceDxdiag
IDeviceInput
System.IDisposable
IDevicePackages
IDeviceStatus
Inherited Members
DeviceBase.DeviceTypeName
DeviceBase.DeviceTypeDisplayName
DeviceBase.Id
DeviceBase.Name
DeviceBase.Alias
DeviceBase.IPAddress
DeviceBase.DisplayName
DeviceBase.Configuration
DeviceBase.ConfigurationType
DeviceBase.AttachedObjectModel
DeviceBase.DeviceImplementation
DeviceBase.ConnectionStatus
DeviceBase.PhoenixId
DeviceBase.Logger
DeviceBase.Events
CapabilityBase.GetCapabilityInterface<T>()
CapabilityBase.HasCapabilityInterface(Type)
CapabilityBase.HasCapabilityInterface<T>()
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.Devices
Assembly: Phoenix.Devices.WindowsPC.dll
Syntax
public sealed class WindowsPC : DeviceBase, IServiceProvider, IDevice, ICapability, IDeviceDxdiag, IDeviceInput, IDisposable, IDeviceStatus

Constructors

View Source

WindowsPC(IPAddress, String, String, IPhoenixLogger, DevicePortalConnectionInfo, String, IEventAggregator, Guid)

Initializes a new instance of the WindowsPC class.

Declaration
public WindowsPC(IPAddress deviceIP, string name, string alias, IPhoenixLogger logger, DevicePortalConnectionInfo connectionInfo, string deviceId, IEventAggregator events, Guid phoenixId)
Parameters
Type Name Description
System.Net.IPAddress deviceIP

The IP address of the device.

System.String name

The name of the device.

System.String alias

The alias of the device if known.

IPhoenixLogger logger

The current logger.

DevicePortalConnectionInfo connectionInfo

Contains the device portal auth settings.

System.String deviceId

The expected device id that will be matched to the id the device provides.

IEventAggregator events

The event aggregator service.

System.Guid phoenixId

The id for the device.

Fields

View Source

SystemPackageRegex

Gets the regex used to determine if a package is a system package.

Declaration
public static readonly Regex SystemPackageRegex
Field Value
Type Description
System.Text.RegularExpressions.Regex

Properties

View Source

ConnectionInfo

Gets or sets the device connection info.

Declaration
public DevicePortalConnectionInfo ConnectionInfo { get; set; }
Property Value
Type Description
DevicePortalConnectionInfo
View Source

IsDevicePortalConnected

Gets a value indicating whether or not there is a device portal connection.

Declaration
public bool IsDevicePortalConnected { get; }
Property Value
Type Description
System.Boolean
View Source

LocalMachine

Gets a value indicating whether or not the WindowsPC is the local machine.

Declaration
public bool LocalMachine { get; }
Property Value
Type Description
System.Boolean
View Source

MaxNumConnectedGamepads

Gets the maximum number of connected gamepads that the device supports at once.

Declaration
public int MaxNumConnectedGamepads { get; }
Property Value
Type Description
System.Int32
View Source

StatusCheckInterval

Gets the duration to wait before refreshing device status.

Declaration
public TimeSpan StatusCheckInterval { get; }
Property Value
Type Description
System.TimeSpan
View Source

SupportedInteractions

Gets the supported interactions for the device. Interactions will throw a DeviceNotSupportedException if an attempt to use an unsupported interaction takes place.

Declaration
public PackageInteractions SupportedInteractions { get; }
Property Value
Type Description
PackageInteractions
View Source

XboxLiveDeviceId

Gets a value representing the XBL device Id.

Declaration
public override string XboxLiveDeviceId { get; }
Property Value
Type Description
System.String
Overrides
DeviceBase.XboxLiveDeviceId

Methods

View Source

AddCapturePrerequisites()

Enables skipping the Microsoft root certificate check in UTC. Required to use Fiddler cert for monitoring UTC HTTP requests.

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

Returns a task representing the work to enable root certificate checks for UTC.

View Source

CaptureDxdiag(String, Boolean)

Captures dxdiag info.

Declaration
public int CaptureDxdiag(string targetPath, bool useCache)
Parameters
Type Name Description
System.String targetPath

The location to save the dxdiag file at.

System.Boolean useCache

Indicates whether or not to use a cached dxdiag, if one exists.

Returns
Type Description
System.Int32

The exit code of the dxdiag process

View Source

CheckCsiUploaderConfig(String)

Checks if the correct CSI uploader configuration is on the pc.

Declaration
[DeviceConfigCheckMethod("CSI Uploader Config", "Windows PC")]
public DeviceConfigResult CheckCsiUploaderConfig(string expected)
Parameters
Type Name Description
System.String expected

The path to the expected configuration file.

Returns
Type Description
DeviceConfigResult

The kit config result object.

View Source

CheckDeveloperMode(String)

Checks the developer mode status and checks if it matches the expected value.

Declaration
[DeviceConfigCheckMethod("Developer Mode", "Windows PC")]
public DeviceConfigResult CheckDeveloperMode(string expectedValue)
Parameters
Type Name Description
System.String expectedValue

The expected developer mode state (must be true or false)

Returns
Type Description
DeviceConfigResult

The result of the check

Remarks

The expectedValue parameter must stay as a string for reflection dependencies for now, which is why "True" or "False" need to be passed in. Any other values will be treated as not matching.

View Source

CheckSandboxId(String)

Checks the sandbox ID and checks if it matches the expected value.

Declaration
[DeviceConfigCheckMethod("Sandbox ID", "Windows PC")]
public DeviceConfigResult CheckSandboxId(string expectedValue)
Parameters
Type Name Description
System.String expectedValue

The sandbox ID to check against

Returns
Type Description
DeviceConfigResult

The result of the check

View Source

Cleanup()

Declaration
public override void Cleanup()
Overrides
DeviceBase.Cleanup()
View Source

Constrain(IPackage)

Declaration
public Task Constrain(IPackage package)
Parameters
Type Name Description
IPackage package
Returns
Type Description
System.Threading.Tasks.Task
View Source

CreateGamepad()

Creates a virtual gamepad for the device.

Declaration
public Guid CreateGamepad()
Returns
Type Description
System.Guid

The id for the gamepad.

View Source

DisconnectAllGamepads()

Disconnects all virtual gamepads from the device.

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

awaitable task

View Source

DisconnectGamepad(Guid)

Disconnects the specified gamepad from the device.

Declaration
public void DisconnectGamepad(Guid gamepadId)
Parameters
Type Name Description
System.Guid gamepadId

The gamepad to disconnect.

View Source

Dispose()

Disposes of the server resources.

Declaration
public void Dispose()
View Source

FixCsiUploaderConfig(String)

Puts the correct CSI uploader configuration on the pc.

Declaration
[DeviceConfigFixMethod("CSI Uploader Config", "Windows PC")]
public DeviceConfigResult FixCsiUploaderConfig(string expected)
Parameters
Type Name Description
System.String expected

The path to the expected configuration file.

Returns
Type Description
DeviceConfigResult

The kit config result object.

View Source

FixDeveloperMode(String)

Fixes the developer mode status to the provided value

Declaration
[DeviceConfigFixMethod("Developer Mode", "Windows PC")]
public DeviceConfigResult FixDeveloperMode(string expectedValue)
Parameters
Type Name Description
System.String expectedValue

The desired developer mode state (must be true or false, or it will not perform the fix)

Returns
Type Description
DeviceConfigResult

The result of the check

Remarks

The expectedValue parameter must stay as a string for reflection dependencies for now, which is why "True" or "False" need to be passed in. Any other values will be treated as not matching.

View Source

FixSandboxId(String)

Sets the sandbox ID to a specified value

Declaration
[DeviceConfigFixMethod("Sandbox ID", "Windows PC")]
public DeviceConfigResult FixSandboxId(string expectedValue)
Parameters
Type Name Description
System.String expectedValue

The sandbox ID to set

Returns
Type Description
DeviceConfigResult

The result of the fix

View Source

GetAllPackages()

Declaration
public Task<IList<IPackage>> GetAllPackages()
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>>
View Source

GetButtonsState(Guid)

Gets the button state for the specified gamepad.

Declaration
public GamepadButtons? GetButtonsState(Guid gamepadId)
Parameters
Type Name Description
System.Guid gamepadId

The gamepad to query buttons from.

Returns
Type Description
System.Nullable<GamepadButtons>

The button states (null if the gamepad cannot be found)

View Source

GetIsRunningAsync(IPackage)

Declaration
public Task<bool> GetIsRunningAsync(IPackage package)
Parameters
Type Name Description
IPackage package
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>
View Source

GetJoystickPosition(Guid, JoystickType)

Gets the joystick position for the specified gamepad.

Declaration
public JoystickPosition GetJoystickPosition(Guid gamepadId, JoystickType joystick)
Parameters
Type Name Description
System.Guid gamepadId

The gamepad to get the joystick position from.

JoystickType joystick

The joystick type to query.

Returns
Type Description
JoystickPosition

The joystick position for the specified gamepad and joystick type. (null if not found)

View Source

GetPackages(PackageFilter)

Declaration
public async Task<IList<IPackage>> GetPackages(PackageFilter filter)
Parameters
Type Name Description
PackageFilter filter
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>>
View Source

GetRunningPackages()

Declaration
public Task<IList<IPackage>> GetRunningPackages()
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>>
View Source

GetService(Type)

Declaration
public override object GetService(Type serviceType)
Parameters
Type Name Description
System.Type serviceType
Returns
Type Description
System.Object
Overrides
CapabilityBase.GetService(Type)
View Source

GetTriggerPosition(Guid, TriggerType)

Gets the trigger position for the specified gamepad.

Declaration
public float? GetTriggerPosition(Guid gamepadId, TriggerType trigger)
Parameters
Type Name Description
System.Guid gamepadId

The gamepad to get the trigger position from.

TriggerType trigger

The trigger type to query.

Returns
Type Description
System.Nullable<System.Single>

The trigger position for the specified gamepad and trigger type (null if gamepad not found)

View Source

HoldButtons(Guid, GamepadButtons)

Holds the specified buttons.

Declaration
public void HoldButtons(Guid gamepadId, GamepadButtons buttons)
Parameters
Type Name Description
System.Guid gamepadId

The gamepad to send the button hold to.

GamepadButtons buttons

The buttons to hold.

View Source

InstallPackageAsync(String)

Installs an application package on the device.

Declaration
public async Task<bool> InstallPackageAsync(string packageFile)
Parameters
Type Name Description
System.String packageFile

The package to install on the device.

Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

True upon success

View Source

IsSystem(WinPackageInfo)

Gets whether or not the package is a system package.

Declaration
public static bool IsSystem(WinPackageInfo package)
Parameters
Type Name Description
WinPackageInfo package

The windows pc package to check.

Returns
Type Description
System.Boolean

Whether or not the passed in package is a system package.

View Source

Launch(IApplication)

Declaration
public Task Launch(IApplication application)
Parameters
Type Name Description
IApplication application
Returns
Type Description
System.Threading.Tasks.Task
View Source

Launch(IApplication, String)

Declaration
public Task Launch(IApplication application, string commandLine)
Parameters
Type Name Description
IApplication application
System.String commandLine
Returns
Type Description
System.Threading.Tasks.Task
View Source

Launch(String)

Declaration
public Task Launch(string aumid)
Parameters
Type Name Description
System.String aumid
Returns
Type Description
System.Threading.Tasks.Task
View Source

Launch(String, String)

Declaration
public Task Launch(string aumid, string commandLine)
Parameters
Type Name Description
System.String aumid
System.String commandLine
Returns
Type Description
System.Threading.Tasks.Task
View Source

OnDeviceAliasChanged(String, String)

Declaration
protected override void OnDeviceAliasChanged(string oldValue, string value)
Parameters
Type Name Description
System.String oldValue
System.String value
Overrides
DeviceBase.OnDeviceAliasChanged(String, String)
View Source

ReleaseButtons(Guid, GamepadButtons)

Releases the specified buttons.

Declaration
public void ReleaseButtons(Guid gamepadId, GamepadButtons buttons)
Parameters
Type Name Description
System.Guid gamepadId

The gamepad to send the button release to.

GamepadButtons buttons

The buttons to release.

View Source

RemoveCapturePrerequisites()

Disables skipping the Microsoft root certificate check in UTC.

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

Returns a task representing the work to disable root certificate checks for UTC.

View Source

Resume(IPackage)

Declaration
public Task Resume(IPackage package)
Parameters
Type Name Description
IPackage package
Returns
Type Description
System.Threading.Tasks.Task
View Source

Serialize()

Serializes device information.

Declaration
public override SerializableIDevice Serialize()
Returns
Type Description
SerializableIDevice

The SerializableIDevice.

Overrides
DeviceBase.Serialize()
View Source

SetJoystickPosition(Guid, JoystickType, JoystickPosition)

Sets the joystick position for the specified gamepad.

Declaration
public void SetJoystickPosition(Guid gamepadId, JoystickType joystick, JoystickPosition position)
Parameters
Type Name Description
System.Guid gamepadId

The gamepad to set the joystick position for.

JoystickType joystick

The joystick type.

JoystickPosition position

The joystick position.

View Source

SetTriggerPosition(Guid, TriggerType, Single)

Sets the trigger position for the specified gamepad.

Declaration
public void SetTriggerPosition(Guid gamepadId, TriggerType trigger, float position)
Parameters
Type Name Description
System.Guid gamepadId

The gamepad to set the trigger position for.

TriggerType trigger

The trigger type.

System.Single position

The trigger position.

View Source

Snap(IApplication)

Declaration
public Task Snap(IApplication application)
Parameters
Type Name Description
IApplication application
Returns
Type Description
System.Threading.Tasks.Task
View Source

Suspend(IPackage)

Declaration
public Task Suspend(IPackage package)
Parameters
Type Name Description
IPackage package
Returns
Type Description
System.Threading.Tasks.Task
View Source

Terminate(IPackage)

Declaration
public Task Terminate(IPackage package)
Parameters
Type Name Description
IPackage package
Returns
Type Description
System.Threading.Tasks.Task
View Source

TryPairWithUser(Guid, PhoenixUser, Boolean)

Tries to pair a gamepad with a user.

Declaration
public Task<bool> TryPairWithUser(Guid gamepadId, PhoenixUser user, bool exclusive)
Parameters
Type Name Description
System.Guid gamepadId

The gamepad to pair the user to.

PhoenixUser user

The user to pair with the gamepad.

System.Boolean exclusive

Whether or not the gamepad should be paired exclusively with the user or not.

Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

Whether or not the pairing was successful.

View Source

Unconstrain(IPackage)

Declaration
public Task Unconstrain(IPackage package)
Parameters
Type Name Description
IPackage package
Returns
Type Description
System.Threading.Tasks.Task
View Source

Uninstall(IPackage)

Declaration
public Task Uninstall(IPackage package)
Parameters
Type Name Description
IPackage package
Returns
Type Description
System.Threading.Tasks.Task
View Source

Unsnap(IPackage)

Declaration
public Task Unsnap(IPackage package)
Parameters
Type Name Description
IPackage package
Returns
Type Description
System.Threading.Tasks.Task

Explicit Interface Implementations

View Source

IDeviceStatus.GetAsync()

Gets the DeviceConnectionStatus of a device.

Declaration
async Task<DeviceConnectionStatus> IDeviceStatus.GetAsync()
Returns
Type Description
System.Threading.Tasks.Task<DeviceConnectionStatus>

The status of the device.

View Source

IDeviceStatus.Set(DeviceConnectionStatus)

Sets the DeviceConnectionStatus for a device.

Declaration
void IDeviceStatus.Set(DeviceConnectionStatus status)
Parameters
Type Name Description
DeviceConnectionStatus status

The status to set.

Implements

System.IServiceProvider
IDevice
ICapability
IDeviceDxdiag
IDeviceInput
System.IDisposable
IDevicePackages
IDeviceStatus
  • View Source
In This Article
Back to top Generated by DocFX