StkCityDatabaseQuery Class |
Namespace: AGI.Foundation.Stk
The StkCityDatabaseQuery type exposes the following members.
Name | Description | |
---|---|---|
StkCityDatabaseQuery | Initializes a new instance of the StkCityDatabaseQuery class |
Name | Description | |
---|---|---|
CentralBodyName |
Gets or sets a regular expression that the CentralBodyName
must match in order to be included in the query.
| |
CityName |
Gets or sets a regular expression that the CityName
must match in order to be included in the query.
| |
CountryName |
Gets or sets a regular expression that the CountryName
must match in order to be included in the query.
| |
MaximumLatitude |
Gets or sets the maximum value of Latitude in radians that
is allowed in order for the entry to be included in the query.
| |
MaximumLongitude |
Gets or sets the maximum value of Longitude in radians that
is allowed in order for the entry to be included in the query.
| |
MinimumLatitude |
Gets or sets the minimum value of Latitude in radians that
is allowed in order for the entry to be included in the query.
| |
MinimumLongitude |
Gets or sets the minimum value of Longitude in radians that
is allowed in order for the entry to be included in the query.
| |
ProvinceName |
Gets or sets a regular expression that the ProvinceName
must match in order to be included in the query.
| |
TypeOfCity |
Gets or sets a value that the TypeOfCity
must match in order to be included in the query.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Matches |
Determines if an entry matches this query.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
The following example shows how to query the city database for cities matching certain criteria:
StkCityDatabase db = new StkCityDatabase(dbDirectory, "stkCityDb"); // Create a query object and then populate it with the properties to query on. // Regular expressions are used to query on strings. StkCityDatabaseQuery query = new StkCityDatabaseQuery { CityName = new Regex("Philadelphia"), // only look in PA, because there's also a New Philadelphia in Ohio ProvinceName = new Regex("Pennsylvania"), }; // Get the database entries matching the query and print out the Longitude and Latitude of each. foreach (StkCityDatabaseEntry entry in db.GetEntries(query)) { Console.WriteLine("{0}: Longitude {1}, Latitude {2}", entry.CityName, entry.Longitude, entry.Latitude); }