Show / Hide Table of Contents

Method OnConnectAsync

OnConnectAsync(CancellationToken)

Handles the connection process of a data source.

Declaration
protected virtual Task OnConnectAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous connect operation.

Remarks

Override this method to perform operations that initiate a connection and start the flow of data from an underlying data source. For instance, operations like connecting a websocket, opening a source file, or starting a polling timer are all operations that may be performed in this method.

This method is called by the ArcGIS Maps SDK when the connection is required. This can be due to an explicit call to ConnectAsync() or called implicitly when a layer that contains the data source needs to be rendered.

Code in a derived class should throw an exception if the connect operation fails. The exception is passed back to the data source and is available in the ConnectionError property.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0200.3 - 200.7
.NET200.3 - 200.7
.NET Windows200.3 - 200.7
.NET Android200.3 - 200.7
.NET iOS200.3 - 200.7
.NET Framework200.3 - 200.7
UWP200.3 - 200.7
In This Article
Back to top Copyright © 2022 Esri.