Class DeviceOperation
An operation that runs on a device.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain.Devices
Assembly: BotBrain.Devices.dll
Syntax
public class DeviceOperation : DeviceOperationBase, IDeviceOperation, ICancellableOperation<IDevice>, IOperation<IDevice>, ICancellableOperation, IOperation, IEquatable<IDeviceOperation?>
Remarks
Initializes a new instance of the DeviceOperation class.
Constructors
View SourceDeviceOperation(Action, string?)
Initializes a new instance of the DeviceOperation class.
Declaration
public DeviceOperation(Action func, string? name = null)
Parameters
Type | Name | Description |
---|---|---|
Action | func | The operation to run. |
string | name | The operation name. |
DeviceOperation(Func<IDevice, CancellationToken, Task<bool>>, string?)
An operation that runs on a device.
Declaration
public DeviceOperation(Func<IDevice, CancellationToken, Task<bool>> func, string? name = null)
Parameters
Type | Name | Description |
---|---|---|
Func<IDevice, CancellationToken, Task<bool>> | func | The operation to run. |
string | name | The operation name. |
Remarks
Initializes a new instance of the DeviceOperation class.
DeviceOperation(Func<Task<bool>>, string?)
Initializes a new instance of the DeviceOperation class.
Declaration
public DeviceOperation(Func<Task<bool>> func, string? name = null)
Parameters
Type | Name | Description |
---|---|---|
Func<Task<bool>> | func | The operation to run. |
string | name | The operation name. |
DeviceOperation(Func<Task>, string?)
Initializes a new instance of the DeviceOperation class.
Declaration
public DeviceOperation(Func<Task> func, string? name = null)
Parameters
Type | Name | Description |
---|---|---|
Func<Task> | func | The operation to run. |
string | name | The operation name. |
Properties
View SourceName
Gets the operation name.
Declaration
public string? Name { get; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceExecuteOn(IDevice, CancellationToken)
Runs the operation on an item.
Declaration
protected override Task<bool> ExecuteOn(IDevice item, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
IDevice | item | The item. |
CancellationToken | token | A token to monitor for cancellation. |
Returns
Type | Description |
---|---|
Task<bool> | A task that returns a boolean indicating success or failure when the operation completes. |
Overrides
View SourceToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |