Table of Contents

Class DataRegistry

Namespace
Tripous.Data
Assembly
Tripous.Data.dll

Registry of the data layer.

public static class DataRegistry
Inheritance
DataRegistry
Inherited Members

Properties

CodeProviders

The list of code providers.

public static DefList<CodeProviderDef> CodeProviders { get; }

Property Value

DefList<CodeProviderDef>

ConfigProperties

The list of configuration property definitions.

public static DefList<ConfigPropertyDef> ConfigProperties { get; }

Property Value

DefList<ConfigPropertyDef>

DocumentHandlers

The list of document handlers

public static DefList<DocumentHandlerDef> DocumentHandlers { get; }

Property Value

DefList<DocumentHandlerDef>

Locators

The list of locator definitions.

public static DefList<LocatorDef> Locators { get; }

Property Value

DefList<LocatorDef>

Lookups

The list of lookup sources definitions

public static DefList<LookupDef> Lookups { get; }

Property Value

DefList<LookupDef>

Modules

The list of module definitions

public static DefList<ModuleDef> Modules { get; }

Property Value

DefList<ModuleDef>

Methods

AddCodeProvider(string)

Adds a definition.

If the definition exists, an exception is thrown.

public static CodeProviderDef AddCodeProvider(string Name)

Parameters

Name string

Returns

CodeProviderDef

AddConfigProperty(string, string, string, UserLevel, ConfigValueKind, string, string, string, ConfigScopeFlags)

Adds a configuration property definition. If the definition exists, an exception is thrown.

public static ConfigPropertyDef AddConfigProperty(string Name, string TitleKey = null, string GroupName = null, UserLevel SecurityLevel = UserLevel.Admin, ConfigValueKind Kind = ConfigValueKind.String, string DefaultValue = null, string TypeName = null, string EditorClassName = null, ConfigScopeFlags Scopes = ConfigScopeFlags.All)

Parameters

Name string
TitleKey string
GroupName string
SecurityLevel UserLevel
Kind ConfigValueKind
DefaultValue string
TypeName string
EditorClassName string
Scopes ConfigScopeFlags

Returns

ConfigPropertyDef

AddDocumentHandler(string, string)

Adds a definition.

If the definition exists, an exception is thrown.

public static DocumentHandlerDef AddDocumentHandler(string Name, string ClassName)

Parameters

Name string
ClassName string

Returns

DocumentHandlerDef

AddLocator(string, string, string, string, string, string)

Adds a locator definition.

If the definition exists, an exception is thrown.

public static LocatorDef AddLocator(string Name, string Source = null, string ClassName = null, string KeyField = null, string FormName = null, string WebFormName = null)

Parameters

Name string
Source string
ClassName string
KeyField string
FormName string
WebFormName string

Returns

LocatorDef

AddLookupListModule(string)

A list module with just Id and Name as fields in its table.

NOTE: The name of the module is the list TableName

If the definition exists, an exception is thrown.

public static ModuleDef AddLookupListModule(string Name)

Parameters

Name string

Returns

ModuleDef

AddLookupListModule(string, string)

A list module with just Id and Name as fields in its table.

NOTE: The name of the module is the list TableName

If the definition exists, an exception is thrown.

public static ModuleDef AddLookupListModule(string Name, string TitleKey)

Parameters

Name string
TitleKey string

Returns

ModuleDef

AddLookupListModule(string, string, string)

A list module with just Id and Name as fields in its table.

NOTE: The name of the module is the list TableName

If the definition exists, an exception is thrown.

public static ModuleDef AddLookupListModule(string TableName, string Name, string TitleKey)

Parameters

TableName string
Name string
TitleKey string

Returns

ModuleDef

AddLookupSource(string, Type, bool)

Adds a lookup source.

If the definition exists, an exception is thrown.

public static LookupDef AddLookupSource(string Name, Type EnumType, bool UseNullItem = false)

Parameters

Name string
EnumType Type
UseNullItem bool

Returns

LookupDef

AddLookupSource(Type, bool)

Adds a lookup source.

The enum type is used as the source.

If the definition exists, an exception is thrown.

public static LookupDef AddLookupSource(Type EnumType, bool UseNullItem = false)

Parameters

EnumType Type
UseNullItem bool

Returns

LookupDef

AddLookupWithClassName(string, string, string, bool)

Adds a lookup source.

If the definition exists, an exception is thrown.

public static LookupDef AddLookupWithClassName(string Name, string ClassName, string FormName = null, bool UseNullItem = false)

Parameters

Name string
ClassName string
FormName string
UseNullItem bool

Returns

LookupDef

AddLookupWithSql(string, string, string, bool)

Adds a lookup source.

If the definition exists, an exception is thrown.

public static LookupDef AddLookupWithSql(string Name, string SqlText = null, string FormName = null, bool UseNullItem = false)

Parameters

Name string
SqlText string
FormName string
UseNullItem bool

Returns

LookupDef

AddLookupWithTableName(string, string, string, bool)

Adds a lookup source.

If the definition exists, an exception is thrown.

public static LookupDef AddLookupWithTableName(string Name, string TableName = null, string FormName = null, bool UseNullItem = false)

Parameters

Name string
TableName string
FormName string
UseNullItem bool

Returns

LookupDef

AddModule(string, string, string, string, bool, UserLevel)

Adds a definition to the registry.

If the definition exists, an exception is thrown.

public static ModuleDef AddModule(string Name, string TitleKey = null, string ClassName = null, string ListSelectSql = null, bool IsSingleSelect = false, UserLevel SecurityLevel = UserLevel.None)

Parameters

Name string
TitleKey string
ClassName string
ListSelectSql string
IsSingleSelect bool
SecurityLevel UserLevel

Returns

ModuleDef

AddOrUpdateCodeProvider(string)

Adds or returns a code provider definition.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static CodeProviderDef AddOrUpdateCodeProvider(string Name)

Parameters

Name string

Returns

CodeProviderDef

AddOrUpdateConfigProperty(string, string, string, UserLevel?, ConfigValueKind?, string, string, string, ConfigScopeFlags?)

Adds or updates a configuration property definition. NOTE: When the definition already exists, non-null parameters and nullable enum parameters with a value update its scalar properties.

public static ConfigPropertyDef AddOrUpdateConfigProperty(string Name, string TitleKey = null, string GroupName = null, UserLevel? SecurityLevel = null, ConfigValueKind? Kind = null, string DefaultValue = null, string TypeName = null, string EditorClassName = null, ConfigScopeFlags? Scopes = null)

Parameters

Name string
TitleKey string
GroupName string
SecurityLevel UserLevel?
Kind ConfigValueKind?
DefaultValue string
TypeName string
EditorClassName string
Scopes ConfigScopeFlags?

Returns

ConfigPropertyDef

AddOrUpdateDocumentHandler(string, string)

Adds or updates a document handler definition.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static DocumentHandlerDef AddOrUpdateDocumentHandler(string Name, string ClassName)

Parameters

Name string
ClassName string

Returns

DocumentHandlerDef

AddOrUpdateLocator(string, string, string, string, string, string)

Adds or updates a locator definition.

Existing field definitions and collections are preserved.

NOTE: When the definition already exists, non-null parameters update its scalar properties. The existing definition instance and its child collections are preserved.

public static LocatorDef AddOrUpdateLocator(string Name, string Source = null, string ClassName = null, string KeyField = null, string FormName = null, string WebFormName = null)

Parameters

Name string
Source string
ClassName string
KeyField string
FormName string
WebFormName string

Returns

LocatorDef

AddOrUpdateLookup(string, Type, string, string, string, string, bool?)

Adds or updates a lookup definition.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static LookupDef AddOrUpdateLookup(string Name, Type EnumType, string TableName, string SqlText, string ClassName, string FormName, bool? UseNullItem)

Parameters

Name string
EnumType Type
TableName string
SqlText string
ClassName string
FormName string
UseNullItem bool?

Returns

LookupDef

AddOrUpdateLookupListModule(string, string, string)

Adds or updates a lookup list module definition.

Existing child definitions and collections are preserved.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static ModuleDef AddOrUpdateLookupListModule(string TableName, string Name, string TitleKey)

Parameters

TableName string
Name string
TitleKey string

Returns

ModuleDef

AddOrUpdateLookupSource(string, Type, bool?)

Adds or updates an enum lookup definition.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static LookupDef AddOrUpdateLookupSource(string Name, Type EnumType, bool? UseNullItem = null)

Parameters

Name string
EnumType Type
UseNullItem bool?

Returns

LookupDef

AddOrUpdateLookupSource(Type, bool?)

Adds or updates an enum lookup definition.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static LookupDef AddOrUpdateLookupSource(Type EnumType, bool? UseNullItem = null)

Parameters

EnumType Type
UseNullItem bool?

Returns

LookupDef

AddOrUpdateLookupWithClassName(string, string, string, bool?)

Adds or updates a class lookup definition.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static LookupDef AddOrUpdateLookupWithClassName(string Name, string ClassName, string FormName = null, bool? UseNullItem = null)

Parameters

Name string
ClassName string
FormName string
UseNullItem bool?

Returns

LookupDef

AddOrUpdateLookupWithSql(string, string, string, bool?)

Adds or updates a SQL lookup definition.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static LookupDef AddOrUpdateLookupWithSql(string Name, string SqlText = null, string FormName = null, bool? UseNullItem = null)

Parameters

Name string
SqlText string
FormName string
UseNullItem bool?

Returns

LookupDef

AddOrUpdateLookupWithTableName(string, string, string, bool?)

Adds or updates a table lookup definition.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static LookupDef AddOrUpdateLookupWithTableName(string Name, string TableName = null, string FormName = null, bool? UseNullItem = null)

Parameters

Name string
TableName string
FormName string
UseNullItem bool?

Returns

LookupDef

AddOrUpdateModule(string, string, string, string, bool?, UserLevel?)

Adds or updates a module definition.

Existing child definitions and collections are preserved.

NOTE: When the definition already exists, non-null parameters and nullable boolean parameters with a value update its scalar properties. The existing definition instance and its child collections are preserved.

public static ModuleDef AddOrUpdateModule(string Name, string TitleKey = null, string ClassName = null, string ListSelectSql = null, bool? IsSingleSelect = null, UserLevel? SecurityLevel = null)

Parameters

Name string
TitleKey string
ClassName string
ListSelectSql string
IsSingleSelect bool?
SecurityLevel UserLevel?

Returns

ModuleDef

CreateModule(string, bool)

Creates and returns a DataModule based on its registered name.

public static DataModule CreateModule(string Name, bool InitializeToo = true)

Parameters

Name string
InitializeToo bool

Returns

DataModule

FindLocator(string)

Returns a locator definition, if any, else null.

public static LocatorDef FindLocator(string Name)

Parameters

Name string

Returns

LocatorDef

GetLocator(string)

Returns a locator definition, if any, else exception.

public static LocatorDef GetLocator(string Name)

Parameters

Name string

Returns

LocatorDef

UpdateLocatorReferences()

Locators are not part of module, so we need a way to update references.

public static void UpdateLocatorReferences()