Parameters
- name
- The name of the dataset to open.
Return Value
A RealtimeTable or RealtimeFeatureClass instance.
| Exception | Description |
|---|---|
| System.InvalidOperationException | No valid real-time datastore has been opened prior to calling this operation. |
| System.ArgumentException | A realtime datastore related exception has occurred. For example, the name is invalid. |
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
| System.NotSupportedException | The data store does not support this operation. |
{
var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer";
// Note: call within QueuedTask.Run()
{
var realtimeServiceConProp = new RealtimeServiceConnectionProperties(
new Uri(url),
RealtimeDatastoreType.StreamService
);
using var realtimeDatastore = new RealtimeDatastore(realtimeServiceConProp);
//A Realtime data store only contains **one** Realtime feature class (or table)
var name = realtimeDatastore.GetTableNames().First();
using (RealtimeFeatureClass realtimeFeatureClass = realtimeDatastore.OpenTable(name) as RealtimeFeatureClass)
{
//feature class, by default, is not streaming (opposite of the stream layer)
realtimeFeatureClass.StartStreaming();
//TODO use the feature class
//...
}
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)