Returns a collection of Table objects which represents all the dBase tables and shapefiles in the directory.

Namespace:  ESRI.ArcGISExplorer.Data

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public ReadOnlyCollection<Table> GetTables()
Visual Basic (Declaration)
Public Function GetTables As ReadOnlyCollection(Of Table)

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. Examples 1 illustrates how to iterate over a collection of all the shapefiles and dBase files 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

See Also