C# Class GDSX.Externals.LinqPad.Driver.MongoDynamicDataContextDriver

Inheritance: LINQPad.Extensibility.DataContext.DynamicDataContextDriver
Show file Open project: gburgett/LinqPad-mongo-driver Class Usage Examples

Public Properties

Property Type Description
CommonTypes Type>.Dictionary

Public Methods

Method Description
BuildAssembly ( ConnectionProperties props, IEnumerable code, AssemblyName name, Func GetDriverFolder ) : void

Compiles the assembly from the code files loaded as strings.

BuildSchema ( ConnectionProperties props, List assemblies ) : List

Builds the Schema tree for display to the user

GenerateCustomInitQuery ( LinqPadQuery query, string nameSpace ) : string
GenerateDynamicCode ( ConnectionProperties props, List assemblies, string nameSpace, string typeName ) : string

Generates the Dynamic Driver class as a string of code to be compiled.

GetAssembliesToAdd ( IConnectionInfo cxInfo ) : IEnumerable

Gets the additional assemblies that the Driver will require at runtime

GetConnectionDescription ( IConnectionInfo cxInfo ) : string
GetContextConstructorArguments ( IConnectionInfo cxInfo ) : object[]

Gets the arguments that are passed to the dynamically instantiated driver

GetContextConstructorParameters ( IConnectionInfo cxInfo ) : ParameterDescriptor[]

Gets an array describing the types of objects that will be passed into the dynamically instantiated driver

GetNamespacesToAdd ( ConnectionProperties props ) : IEnumerable

Gets the additional namespaces that should be imported for queries using this driver

GetNamespacesToAdd ( IConnectionInfo cxInfo ) : IEnumerable

Gets the additional namespaces that should be imported for queries using this driver

GetSchemaAndBuildAssembly ( IConnectionInfo cxInfo, AssemblyName assemblyToBuild, string &nameSpace, string &typeName ) : List

Creates the Schema which displays information about the connection to the user, and dynamically generates the driver as an assembly.

GetStaticCodeFiles ( ) : IEnumerable

Loads up the Static code files which should be built with the dynamic driver as strings

InitializeContext ( IConnectionInfo cxInfo, object context, LINQPad.Extensibility.DataContext.QueryExecutionManager executionManager ) : void

Initializes the driver after it has been instantiated.

ShowConnectionDialog ( IConnectionInfo cxInfo, bool isNewConnection ) : bool

LinqPad calls this to display the Connection Options dialog & generate the connection properties.

TearDownContext ( IConnectionInfo cxInfo, object context, LINQPad.Extensibility.DataContext.QueryExecutionManager executionManager, object constructorArguments ) : void

Called when the Driver context is torn down to clean up resources

Private Methods

Method Description
DoPluralize ( string s ) : string
TryLoadType ( IEnumerable assemblies, string typeName ) : Type

Gets the requested type name out of one of the loaded assemblies, or null if it can't be found

Method Details

BuildAssembly() public method

Compiles the assembly from the code files loaded as strings.
public BuildAssembly ( ConnectionProperties props, IEnumerable code, AssemblyName name, Func GetDriverFolder ) : void
props ConnectionProperties The deserialized Connection Properties
code IEnumerable The loaded strings of C# code
name System.Reflection.AssemblyName The location where the dynamically generated assembly should be created
GetDriverFolder Func An injected function that gets the LinqPad driver folder
return void

BuildSchema() public method

Builds the Schema tree for display to the user
public BuildSchema ( ConnectionProperties props, List assemblies ) : List
props ConnectionProperties The deserialized Connection Properties
assemblies List The already-loaded assemblies.
return List

GenerateCustomInitQuery() public method

public GenerateCustomInitQuery ( LinqPadQuery query, string nameSpace ) : string
query LinqPadQuery
nameSpace string
return string

GenerateDynamicCode() public method

Generates the Dynamic Driver class as a string of code to be compiled.
public GenerateDynamicCode ( ConnectionProperties props, List assemblies, string nameSpace, string typeName ) : string
props ConnectionProperties The deserialized Connection Properties
assemblies List The already-loaded assemblies.
nameSpace string The namespace of the driver class
typeName string The name of the driver class
return string

GetAssembliesToAdd() public method

Gets the additional assemblies that the Driver will require at runtime
public GetAssembliesToAdd ( IConnectionInfo cxInfo ) : IEnumerable
cxInfo IConnectionInfo the serialized connection properties.
return IEnumerable

GetConnectionDescription() public method

public GetConnectionDescription ( IConnectionInfo cxInfo ) : string
cxInfo IConnectionInfo
return string

GetContextConstructorArguments() public method

Gets the arguments that are passed to the dynamically instantiated driver
public GetContextConstructorArguments ( IConnectionInfo cxInfo ) : object[]
cxInfo IConnectionInfo the serialized connection properties.
return object[]

GetContextConstructorParameters() public method

Gets an array describing the types of objects that will be passed into the dynamically instantiated driver
public GetContextConstructorParameters ( IConnectionInfo cxInfo ) : ParameterDescriptor[]
cxInfo IConnectionInfo the serialized connection properties.
return ParameterDescriptor[]

GetNamespacesToAdd() public static method

Gets the additional namespaces that should be imported for queries using this driver
public static GetNamespacesToAdd ( ConnectionProperties props ) : IEnumerable
props ConnectionProperties the deserialized ConnectionProperties object.
return IEnumerable

GetNamespacesToAdd() public method

Gets the additional namespaces that should be imported for queries using this driver
public GetNamespacesToAdd ( IConnectionInfo cxInfo ) : IEnumerable
cxInfo IConnectionInfo the serialized connection properties.
return IEnumerable

GetSchemaAndBuildAssembly() public method

Creates the Schema which displays information about the connection to the user, and dynamically generates the driver as an assembly.
public GetSchemaAndBuildAssembly ( IConnectionInfo cxInfo, AssemblyName assemblyToBuild, string &nameSpace, string &typeName ) : List
cxInfo IConnectionInfo the serialized connection properties.
assemblyToBuild System.Reflection.AssemblyName The location where the dynamically generated assembly should be created
nameSpace string The namespace of the driver class
typeName string The name of the driver class
return List

GetStaticCodeFiles() public method

Loads up the Static code files which should be built with the dynamic driver as strings
public GetStaticCodeFiles ( ) : IEnumerable
return IEnumerable

InitializeContext() public method

Initializes the driver after it has been instantiated.
public InitializeContext ( IConnectionInfo cxInfo, object context, LINQPad.Extensibility.DataContext.QueryExecutionManager executionManager ) : void
cxInfo IConnectionInfo the serialized connection properties.
context object The driver object
executionManager LINQPad.Extensibility.DataContext.QueryExecutionManager The current Query Execution Manager for this query
return void

ShowConnectionDialog() public method

LinqPad calls this to display the Connection Options dialog & generate the connection properties.
public ShowConnectionDialog ( IConnectionInfo cxInfo, bool isNewConnection ) : bool
cxInfo IConnectionInfo the serialized connection properties.
isNewConnection bool True if this is a brand new connection
return bool

TearDownContext() public method

Called when the Driver context is torn down to clean up resources
public TearDownContext ( IConnectionInfo cxInfo, object context, LINQPad.Extensibility.DataContext.QueryExecutionManager executionManager, object constructorArguments ) : void
cxInfo IConnectionInfo
context object
executionManager LINQPad.Extensibility.DataContext.QueryExecutionManager
constructorArguments object
return void

Property Details

CommonTypes public static property

Types common to all Bson driver instances
public static Dictionary CommonTypes
return Type>.Dictionary