Class CastAdapter
Represents an adapter for the Cast domain to simplify the command interface.
public class CastAdapter
- Inheritance
-
CastAdapter
- Inherited Members
Constructors
CastAdapter(IDevToolsSession)
Initializes a new instance of the CastAdapter class.
public CastAdapter(IDevToolsSession session)
Parameters
sessionIDevToolsSessionThe IDevToolsSession to be used with this adapter.
Exceptions
- ArgumentNullException
If
sessionis null.
Properties
Session
Gets the DevToolsSession associated with the adapter.
public IDevToolsSession Session { get; }
Property Value
Methods
Disable(DisableCommandSettings?, CancellationToken, int?, bool)
Stops observing for sinks and issues.
public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandDisableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Enable(EnableCommandSettings, CancellationToken, int?, bool)
Starts observing for sinks that can be used for tab mirroring, and if set, sinks compatible with |presentationUrl| as well. When sinks are found, a |sinksUpdated| event is fired. Also starts observing for issue messages. When an issue is added or removed, an |issueUpdated| event is fired.
public Task<EnableCommandResponse?> Enable(EnableCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandEnableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
SetSinkToUse(SetSinkToUseCommandSettings, CancellationToken, int?, bool)
Sets a sink to be used when the web page requests the browser to choose a sink via Presentation API, Remote Playback API, or Cast SDK.
public Task<SetSinkToUseCommandResponse?> SetSinkToUse(SetSinkToUseCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandSetSinkToUseCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
StartDesktopMirroring(StartDesktopMirroringCommandSettings, CancellationToken, int?, bool)
Starts mirroring the desktop to the sink.
public Task<StartDesktopMirroringCommandResponse?> StartDesktopMirroring(StartDesktopMirroringCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandStartDesktopMirroringCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
StartTabMirroring(StartTabMirroringCommandSettings, CancellationToken, int?, bool)
Starts mirroring the tab to the sink.
public Task<StartTabMirroringCommandResponse?> StartTabMirroring(StartTabMirroringCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandStartTabMirroringCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
StopCasting(StopCastingCommandSettings, CancellationToken, int?, bool)
Stops the active Cast session on the sink.
public Task<StopCastingCommandResponse?> StopCasting(StopCastingCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandStopCastingCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Events
IssueUpdated
This is fired whenever the outstanding issue/error message changes. |issueMessage| is empty if there is no issue.
public event EventHandler<IssueUpdatedEventArgs>? IssueUpdated
Event Type
SinksUpdated
This is fired whenever the list of available sinks changes. A sink is a device or a software surface that you can cast to.
public event EventHandler<SinksUpdatedEventArgs>? SinksUpdated