TrafficFetcher Class |
Namespace: Telogis.GeoBase.Traffic
The TrafficFetcher type exposes the following members.
Name | Description | |
---|---|---|
TrafficFetcher |
Create a new TrafficFetcher
|
Name | Description | |
---|---|---|
AddSource(IGenericTrafficSource) |
Add a new ITrafficSource to the TrafficFetcher's traffic source list.
| |
AddSource(IGenericTrafficSource, TimeSpan) |
Add a new ITrafficSource to the TrafficFetcher's traffic source list.
| |
AddSource(String, Type, TimeSpan, HandleDataDelegate) |
Add a new traffic source to the TrafficFetcher's traffic source list.
| |
AddSource(String, Type, TimeSpan, HandleDataDelegate, ICredentials) |
Add a new traffic source to the TrafficFetcher's traffic source list.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetExpiry |
Get the date/time that the traffic data is still valid.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetLatestTraffic |
Synchronously, get the latest traffic data update from the list of ITrafficSources.
| |
GetLatestTraffic(DateTime) | Obsolete. | |
GetLatestTraffic(TimeSpan) |
Get the latest traffic data update from the list of ITrafficSource.
| |
GetLatestTraffic(DateTime, TimeSpan) | Obsolete. | |
GetLatestTrafficAsync |
Asynchronously, get the latest traffic data update from the list of ITrafficSources, based on the given date/time.
| |
GetLatestTrafficAsync(DateTime) | Obsolete. | |
GetSourceByURL |
Creates an ITrafficSource from the given URL.
| |
GetSourcesByType |
Creates an ITrafficSource from the given type.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
InsertSource |
Insert an ITrafficSource to the TrafficFetcher's traffic source list at the given position.
| |
RemoveSourcesByType |
Remove sources of the given type from ITrafficSource to the TrafficFetcher's source list.
| |
RemoveSourcesByUrl |
Remove sources with given URL from ITrafficSource to the TrafficFetcher's source list.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
TrafficUpdated |
This event handler is called when an update is received from an
ITrafficSource. It might not be called on the thread that called
GetLatestTraffic, so event handler implementations need to be careful not to use
synchronous calls that might deadlock. For example, if GetLatestTraffic was called from
a UI thread then the event handler must use BeginInvoke to update UI elements.
|
The TrafficFetcher class is used to retrieve an up-to-date Traffic object based on traffic information from the Traffic's sources. The TrafficFetcher does not automate the process of obtaining an updated Traffic, but instead, provides the GetLatestTraffic(DateTime) method, which can be called synchronously, or asynchronously.
For synchronous mode, set blocking to true. In this mode, the Traffic object will not be returned until all the ITrafficSources have been updated, or the timeout time has elapsed.
For asynchronous mode, set blocking to false, and wait until the TrafficUpdated event is called, signalling that the ITrafficSource data has been updated.
Related articles: Routing with Traffic.