Show / Hide Table of Contents

Interface IConnectable<T>

Represents a connection.

Inherited Members
IConnectable.ConnectionStatusChanged
IConnectable.ConnectionName
IConnectable.ConnectAsync(TimeSpan?)
IConnectable.DisconnectAsync(TimeSpan?)
IConnectable.ConnectAsync(CancellationToken)
IConnectable.DisconnectAsync(CancellationToken)
IHasConnectionStatus.ConnectionStatus
Namespace: Microsoft.XboxStudios.DeviceConsole.Connections
Assembly: DeviceConsole.Abstractions.dll
Syntax
public interface IConnectable<T> : IConnectable, IHasConnectionStatus
Type Parameters
Name Description
T

The connection type.

Methods

View Source

WithConnection(Func<T, CancellationToken, Task>, CancellationToken)

Ensures that the connection is working to before performing the operation.

Declaration
Task WithConnection(Func<T, CancellationToken, Task> operation, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Func<T, CancellationToken, Task> operation

The operation to run.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task

A task for the asynchronous operation.

View Source

WithConnection(Func<T, Task>, CancellationToken)

Ensures that the connection is working to before performing the operation.

Declaration
Task WithConnection(Func<T, Task> operation, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Func<T, Task> operation

The operation to run.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task

A task for the asynchronous operation.

View Source

WithConnection<TResult>(Func<T, CancellationToken, Task<TResult>>, CancellationToken)

Ensures that the connection is working to before performing the operation.

Declaration
Task<TResult> WithConnection<TResult>(Func<T, CancellationToken, Task<TResult>> operation, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Func<T, CancellationToken, Task<TResult>> operation

The operation to run.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task<TResult>

A task for the asynchronous operation.

Type Parameters
Name Description
TResult

The type of the return value.

View Source

WithConnection<TResult>(Func<T, Task<TResult>>, CancellationToken)

Ensures that the connection is working to before performing the operation.

Declaration
Task<TResult> WithConnection<TResult>(Func<T, Task<TResult>> operation, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Func<T, Task<TResult>> operation

The operation to run.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task<TResult>

A task for the asynchronous operation.

Type Parameters
Name Description
TResult

The type of the return value.

Extension Methods

IHasConnectionStatusExtensions.IsConnected(IHasConnectionStatus)
  • View Source
In This Article
Back to top Generated by DocFX