ArcGIS Explorer Component Help |
DataDirectory..::.GetTables Method (TableDiscoveryOptions) |
DataDirectory Class Example See Also |
Returns a collection of Table objects for the given the supplied search criteria.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public ReadOnlyCollection<Table> GetTables( TableDiscoveryOptions tableDiscoveryOptions ) |
Visual Basic (Declaration) |
---|
Public Function GetTables ( _ tableDiscoveryOptions As TableDiscoveryOptions _ ) As ReadOnlyCollection(Of Table) |
Parameters
- tableDiscoveryOptions
- Type: ESRI.ArcGISExplorer.Data..::.TableDiscoveryOptions
One of the TableDiscoveryOptions values which determines the type of tables to return.
Return Value
A ReadOnlyCollection object consisting of Table objects each of which represents either a dBase table (non-spatial) or a shapefile (spatial, vector format).Examples
The code below explores the contents of a directory. Example 2 illustrates how to iterate over a collection of all shapefiles in the specified directory.
CopyC#
//The "C:\Data" directory contains the following: //mountains shapefile //mtn_ratings dBase file //northgorms.jpg //southgorms.jpg //Create a DataDirectory object for the specified file path DataDirectory dir = new DataDirectory(@"C:\Data"); //Example 1 - print out the names of all dBase files and shapefiles foreach (Table table in dir.GetTables()) { System.Diagnostics.Debug.Print(table.Name); } //Output prints: // mountains // mtn_ratings //Example 2 - print out the names of all shapefiles foreach (Table shapefile in dir.GetTables(TableDiscoveryOptions.Spatial)) { System.Diagnostics.Debug.Print(shapefile.Name); } //Output prints: // mountains //Example 3 - print out the names of all raster files foreach (Raster raster in dir.GetRasters()) { System.Diagnostics.Debug.Print(raster.Name); } //Output prints: // northgorms.jpg // southgorms.jpg
CopyVB.NET
'The "C:\Data" directory contains the following: 'mountains shapefile 'mtn_ratings dBase file 'northgorms.jpg 'southgorms.jpg 'Create a DataDirectory object for the specified file path Dim dir As DataDirectory = New DataDirectory("C:\Data") 'Example 1 - print out the names of all dBase files and shapefiles For Each t As Table In dir.GetTables() System.Diagnostics.Debug.Print(t.Name) Next 'Output prints: ' mountains ' mtn_ratings 'Example 2 - print out the names of all shapefiles For Each shapefile As Table In dir.GetTables(TableDiscoveryOptions.Spatial) System.Diagnostics.Debug.Print(shapefile.Name) Next 'Output prints: ' mountains 'Example 3 - print out the names of all raster files For Each raster As Raster In dir.GetRasters() System.Diagnostics.Debug.Print(raster.Name) Next 'Output prints: ' northgorms.jpg ' southgorms.jpg