DDGCStreetSearcher Class |
Namespace: Telogis.GeoBase
The DDGCStreetSearcher type exposes the following members.
Name | Description | |
---|---|---|
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 DDGCStreetSearcher object belonging to a DrillDownGeoCoder instance can be obtained by calling the DrillDownGeoCoder.GetStreetSearcher() method.
Caution |
---|
If the parent DrillDownGeoCoder is disposed of, the DDGCStreetSearcher will cease to function correctly. |
The set of streets searched will be limited to the regions set on the parent DrillDownGeoCoder. 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); // Assume we have set the following regions: // Region 0 - California // Region 1 - Orange // Region 2 - Aliso Viejo DDGCStreetSearcher streetSearch = ddgc.GetStreetSearcher(); streetSearch.OnFoundResults += new Action<StreetSearchResult>(streetSearch_OnFoundResults); streetSearch.ChangeSearchTerm("Enterprise"); } void streetSearch_OnFoundResults(StreetSearchResult obj) { if (obj.Status != SearchResult.Searching) { foreach (StreetData sd in obj.Results) { Console.WriteLine(sd.CollatedName); } } } // Output: // Enterprise // Enterprise Ct/Way