DDGCRegionSearcher Class |
Namespace: Telogis.GeoBase
The DDGCRegionSearcher type exposes the following members.
Name | Description | |
---|---|---|
Level |
Gets or sets the region level within which to search.
| |
SearchDelay | Obsolete.
Delay before the search starts. This is to give the user a chance to change
the search term before committing to starting the search.
(Inherited from AsyncSearcherResultElementT, ResultT.) | |
Status | Obsolete.
Returns the state of the asynchronous search.
(Inherited from AsyncSearcherResultElementT, ResultT.) |
Name | Description | |
---|---|---|
ChangeSearchTerm |
Execute a new search, while retaining any search results that match the new query string. Calling this
method will abort any search currently in progress.
(Inherited from AsyncSearcherResultElementT, ResultT.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
OnFoundResults |
Event that fires when the search results change.
(Inherited from AsyncSearcherResultElementT, ResultT.) |
The DDGCRegionSearcher object belonging to a DrillDownGeoCoder instance can be obtained by calling the DrillDownGeoCoder.GetRegionSearcher() method.
Caution |
---|
If the parent DrillDownGeoCoder is disposed of, the DDGCRegionSearcher will cease to function correctly. |
The set of regions searched at a given region level will be limited by the regions set on the parent DrillDownGeoCoder; e.g. if Region 0 (State) is set to California, then a search of Region 1 (County) will only return counties within California. When the ChangeSearchTerm(String) method is called, a new search will begin; when this search is complete, the OnFoundResults event will fire. If a new search term is entered before the previous search has completed, the previous search will be aborted.
public void DDGCDemo() { DrillDownGeoCoder ddgc = new DrillDownGeoCoder(Country.USA); DDGCRegionSearcher regionSearch = ddgc.GetRegionSearcher(); regionSearch.OnFoundResults += new Action<RegionSearchResult>(regionSearch_OnFoundResults); regionSearch.Level = 0; regionSearch.ChangeSearchTerm("New"); } void regionSearch_OnFoundResults(RegionSearchResult obj) { if (obj.Status != SearchResult.Searching) { foreach (RegionData rd in obj.Results) { Console.WriteLine(rd.Name); } } } // Output: // New Hampshire // New Jersey // New Mexico // New York