C# Class DatabaseManager.SchemaExtractor

Class able to extract SquemaInfo from assemblies.
Inheritance: System.MarshalByRefObject
Exibir arquivo Open project: VelocityDB/VelocityDB

Public Methods

Method Description
Extract ( string pClassesFilenames, string pDependenciesFilenames ) : SchemaInfo

Extract schema information from assemblies.

GetDataMembers ( Type pType ) : List

Gets public instance fields and properties excluding ones internally defined by VelocityDB.

GetTypeFromAnyAssemblyVersion ( string typeName ) : Type

Load type using Type.GetType(string), and if fails, attempt to load same type from an assembly by assembly name, without specifying assembly version or any other part of the signature

Private Methods

Method Description
AssemblyResolve ( object sender, ResolveEventArgs pArgs ) : Assembly

When an assembly is not found, search for it on the already loaded ones.

CreateNamesDictionary ( Type pPersistables, SchemaInfo &pSchema ) : void

Creates dictionaries that maps from types fullnames to a suitable collection name. The resulting name is usually simple the name of the type. When there is more than one type with the same name, FullName is progressively prepended to name until there is no ambiguity. Two dictionaries are generated, one with pluralized last name and one with singular one.

GetAssembliesAndTypes ( string pClassFilenames, string pDependencyFilenames, SchemaInfo &pSchema ) : void

Load assemblies and get exported persistable types from them.

GetAssembliesAndTypesHelper ( string pClassFilenames, string pDependencyFilenames, List &pAssemblyNames, List &pTypes, List &pActualDependencies ) : void

Internal method to be used on a clean domain.

GetLoadedAssemblies ( ) : string[]

Gets filename of all non-dynamic loaded assemblies.

OnAssemblyResolve ( object sender, ResolveEventArgs args ) : Assembly
SolveNameClash ( Type>.IGrouping pNameClash ) : string[]>.Dictionary

From types with the same Name, create new names progressively using FullName to disambiguate.

Method Details

Extract() public static method

Extract schema information from assemblies.
public static Extract ( string pClassesFilenames, string pDependenciesFilenames ) : SchemaInfo
pClassesFilenames string Assemblies containing /// desired persistable types.
pDependenciesFilenames string Assemblies required by /// pClassesFilenames Assemblies.
return SchemaInfo

GetDataMembers() public static method

Gets public instance fields and properties excluding ones internally defined by VelocityDB.
public static GetDataMembers ( Type pType ) : List
pType System.Type
return List

GetTypeFromAnyAssemblyVersion() public static method

Load type using Type.GetType(string), and if fails, attempt to load same type from an assembly by assembly name, without specifying assembly version or any other part of the signature
public static GetTypeFromAnyAssemblyVersion ( string typeName ) : Type
typeName string /// The assembly-qualified name of the type to get. /// See System.Type.AssemblyQualifiedName. /// If the type is in the currently executing assembly or in Mscorlib.dll, it /// is sufficient to supply the type name qualified by its namespace. ///
return System.Type