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
Target | Versions |
---|---|
.NET Standard 2.0 | 200.3 - 200.5 |
.NET | 200.3 - 200.5 |
.NET Windows | 200.3 - 200.5 |
.NET Android | 200.3 - 200.5 |
.NET iOS | 200.3 - 200.5 |
.NET Framework | 200.3 - 200.5 |
UWP | 200.3 - 200.5 |