C# Class FdoToolbox.Core.Utility.ExpressUtility

Utility class for common FDO tasks and functionality
Afficher le fichier Open project: jumpinjackie/fdotoolbox Class Usage Examples

Méthodes publiques

Méthode Description
ConvertFromNameValueCollection ( NameValueCollection nameValueCollection ) : string

Converts a NameValueCollection to a connection string style string

ConvertFromString ( string str ) : NameValueCollection

Converts a specially formatted string to a NameValueCollection

CopyAllSpatialContexts ( FdoConnection source, FdoConnection target, bool overwrite ) : void

Copies all spatial contexts from one connection to another. If the target connection only supports one spatial context, then the active spatial context is copied across.

CopyAllSpatialContexts ( ICollection spatialContexts, FdoConnection target, bool overwrite ) : void

Copies all spatial contexts from one connection to another. If the target connection only supports one spatial context, then the active spatial context is copied across.

CreateBulkCopy ( FdoConnection sourceConn, FdoConnection targetConn, string srcSchemaName, FeatureQueryOptions srcQuery, string targetSchemaName, string targetClassName, NameValueCollection propertyMapping ) : FdoBulkCopy

Utility method to create a bulk copy operation from one class to another

CreateBulkCopy ( FdoConnection source, string schemaName, string className, string provider, string savePath ) : FdoBulkCopy

Utility method to create a feature class dump bulk copy

CreateBulkCopy ( string sourceFile, string targetPath, bool copySpatialContexts, bool fixIncompatibleSchema, bool flattenGeometries ) : FdoBulkCopy

Creates a FDO bulk copy task. The target file will be created as part of this method call. If the target path is a directory, it is assumed that SHP files are to be created and copied to.

CreateFlatFileConnection ( string sourceFile ) : FdoConnection

Creates a connection to a FDO provider. The FDO provider must be a flat-file provider.

CreateFlatFileConnection ( string provider, string file ) : FdoConnection

Creates a connection to a FDO provider. The FDO provider must be a flat-file provider.

CreateFlatFileDataSource ( string file ) : bool

Creates a FDO data source. The provider must be a flat-file provider

CreateFlatFileDataSource ( string file, bool deleteIfExists ) : bool

Creates a FDO data source. The provider must be a flat-file provider

CreateFlatFileDataSource ( string provider, string path ) : bool

Creates a FDO data source. The provider must be a flat-file provider

CreateFlatFileDataSource ( string provider, string path, bool deleteIfExists ) : bool

Creates a FDO data source. The provider must be a flat-file provider

GetClassNames ( string sourceFile ) : string[]

Gets all class names from the specified flat-file data source

GetClrTypeFromFdoDataType ( DataType dt ) : Type

Gets the CLR type from a FDO data type

GetDataColumnForProperty ( DataPropertyDefinition dp ) : DataColumn

Converts a DataPropertyDefinition into a DataColumn

GetDataPropertyForColumn ( DataColumn col ) : DataPropertyDefinition

Converts a DataColumn object into a DataPropertyDefinition

GetFdoDataTypeFromClrType ( Type t ) : DataType

Gets the FDO data type for a CLR type

GetRelatedFiles ( string shapeFile ) : string[]

Gets the related files of a Shape File

HasRaster ( ClassDefinition cls ) : bool

Determines whether the specified class has a raster property.

IsShp ( string targetPath ) : bool

Determines whether the specified target path is a valid SHP provider file path

Private Methods

Méthode Description
GetFileParameter ( string provider ) : string
GetProviderFromFileExtension ( string path ) : string

Infers the FDO provider name from the file's extension

Method Details

ConvertFromNameValueCollection() public static méthode

Converts a NameValueCollection to a connection string style string
public static ConvertFromNameValueCollection ( NameValueCollection nameValueCollection ) : string
nameValueCollection System.Collections.Specialized.NameValueCollection
Résultat string

ConvertFromString() public static méthode

Converts a specially formatted string to a NameValueCollection
public static ConvertFromString ( string str ) : NameValueCollection
str string
Résultat System.Collections.Specialized.NameValueCollection

CopyAllSpatialContexts() public static méthode

Copies all spatial contexts from one connection to another. If the target connection only supports one spatial context, then the active spatial context is copied across.
public static CopyAllSpatialContexts ( FdoConnection source, FdoConnection target, bool overwrite ) : void
source FdoToolbox.Core.Feature.FdoConnection The source connection
target FdoToolbox.Core.Feature.FdoConnection The target connection
overwrite bool If true will overwrite any existing spatial contexts, otherwise it will add them. This value is ignored if the target connection does not support multiple spatial contexts
Résultat void

CopyAllSpatialContexts() public static méthode

Copies all spatial contexts from one connection to another. If the target connection only supports one spatial context, then the active spatial context is copied across.
public static CopyAllSpatialContexts ( ICollection spatialContexts, FdoConnection target, bool overwrite ) : void
spatialContexts ICollection The spatial contexts.
target FdoToolbox.Core.Feature.FdoConnection The target.
overwrite bool if set to true [overwrite].
Résultat void

CreateBulkCopy() public static méthode

Utility method to create a bulk copy operation from one class to another
public static CreateBulkCopy ( FdoConnection sourceConn, FdoConnection targetConn, string srcSchemaName, FeatureQueryOptions srcQuery, string targetSchemaName, string targetClassName, NameValueCollection propertyMapping ) : FdoBulkCopy
sourceConn FdoToolbox.Core.Feature.FdoConnection
targetConn FdoToolbox.Core.Feature.FdoConnection
srcSchemaName string
srcQuery FdoToolbox.Core.Feature.FeatureQueryOptions
targetSchemaName string
targetClassName string
propertyMapping System.Collections.Specialized.NameValueCollection
Résultat FdoToolbox.Core.ETL.Specialized.FdoBulkCopy

CreateBulkCopy() public static méthode

Utility method to create a feature class dump bulk copy
public static CreateBulkCopy ( FdoConnection source, string schemaName, string className, string provider, string savePath ) : FdoBulkCopy
source FdoToolbox.Core.Feature.FdoConnection
schemaName string
className string
provider string
savePath string
Résultat FdoToolbox.Core.ETL.Specialized.FdoBulkCopy

CreateBulkCopy() public static méthode

Creates a FDO bulk copy task. The target file will be created as part of this method call. If the target path is a directory, it is assumed that SHP files are to be created and copied to.
public static CreateBulkCopy ( string sourceFile, string targetPath, bool copySpatialContexts, bool fixIncompatibleSchema, bool flattenGeometries ) : FdoBulkCopy
sourceFile string The path to the source file.
targetPath string /// The path to the target file/directory. If it is a directory, it is assumed /// that SHP files are to be created and copied to. ///
copySpatialContexts bool If true, will also copy spatial contexts
fixIncompatibleSchema bool If true, will try to fix the source schema to make it compatible with the target connection. If false, an exception will be thrown
flattenGeometries bool If true, will strip all Z and M coordinates from all geometries that are copied
Résultat FdoToolbox.Core.ETL.Specialized.FdoBulkCopy

CreateFlatFileConnection() public static méthode

Creates a connection to a FDO provider. The FDO provider must be a flat-file provider.
public static CreateFlatFileConnection ( string sourceFile ) : FdoConnection
sourceFile string
Résultat FdoToolbox.Core.Feature.FdoConnection

CreateFlatFileConnection() public static méthode

Creates a connection to a FDO provider. The FDO provider must be a flat-file provider.
public static CreateFlatFileConnection ( string provider, string file ) : FdoConnection
provider string
file string
Résultat FdoToolbox.Core.Feature.FdoConnection

CreateFlatFileDataSource() public static méthode

Creates a FDO data source. The provider must be a flat-file provider
public static CreateFlatFileDataSource ( string file ) : bool
file string The file.
Résultat bool

CreateFlatFileDataSource() public static méthode

Creates a FDO data source. The provider must be a flat-file provider
public static CreateFlatFileDataSource ( string file, bool deleteIfExists ) : bool
file string The file
deleteIfExists bool if set to true will delete the file if it already exists.
Résultat bool

CreateFlatFileDataSource() public static méthode

Creates a FDO data source. The provider must be a flat-file provider
public static CreateFlatFileDataSource ( string provider, string path ) : bool
provider string The provider.
path string The path.
Résultat bool

CreateFlatFileDataSource() public static méthode

Creates a FDO data source. The provider must be a flat-file provider
public static CreateFlatFileDataSource ( string provider, string path, bool deleteIfExists ) : bool
provider string The provider.
path string The path.
deleteIfExists bool if set to true deletes the specified file if it exists.
Résultat bool

GetClassNames() public static méthode

Gets all class names from the specified flat-file data source
public static GetClassNames ( string sourceFile ) : string[]
sourceFile string
Résultat string[]

GetClrTypeFromFdoDataType() public static méthode

Gets the CLR type from a FDO data type
public static GetClrTypeFromFdoDataType ( DataType dt ) : Type
dt DataType
Résultat System.Type

GetDataColumnForProperty() public static méthode

Converts a DataPropertyDefinition into a DataColumn
public static GetDataColumnForProperty ( DataPropertyDefinition dp ) : DataColumn
dp DataPropertyDefinition The data property definition
Résultat System.Data.DataColumn

GetDataPropertyForColumn() public static méthode

Converts a DataColumn object into a DataPropertyDefinition
public static GetDataPropertyForColumn ( DataColumn col ) : DataPropertyDefinition
col System.Data.DataColumn The data column
Résultat DataPropertyDefinition

GetFdoDataTypeFromClrType() public static méthode

Gets the FDO data type for a CLR type
public static GetFdoDataTypeFromClrType ( Type t ) : DataType
t System.Type
Résultat DataType

GetRelatedFiles() public static méthode

Gets the related files of a Shape File
public static GetRelatedFiles ( string shapeFile ) : string[]
shapeFile string The shape file.
Résultat string[]

HasRaster() public static méthode

Determines whether the specified class has a raster property.
public static HasRaster ( ClassDefinition cls ) : bool
cls ClassDefinition The class
Résultat bool

IsShp() public static méthode

Determines whether the specified target path is a valid SHP provider file path
public static IsShp ( string targetPath ) : bool
targetPath string The target path.
Résultat bool