Class Schema
Base class of the schema.
Inheritance
Inherited Members
Namespace: Terrasoft.Core
Assembly: Terrasoft.Core.dll
Syntax
[MetaType("{3D13F030-6745-4f00-A7DB-07D3823B6A03}")]
[DesignModeProperty(Name = "Caption", FormatType = DesignModePropertyScriptFormatType.SetMethod, MetaPropertyName = "B4", ValuesProvider = "LocalizableStringProvider", Editor = "xtype=localizabletextedit", ForeignPackageEditMode = ForeignPackageEditMode.Edit, IsRequired = true)]
[DesignModeProperty(Name = "Description", UsageType = DesignModeUsageType.Advanced, MetaPropertyName = "B5", ValuesProvider = "LocalizableStringProvider", Editor = "xtype=localizabletextedit")]
[DesignModeProperty(Name = "Methods", UsageType = DesignModeUsageType.None, MetaPropertyName = "B1", ForeignPackageEditMode = ForeignPackageEditMode.ItemsAdd | ForeignPackageEditMode.ItemsMove)]
[DesignModeProperty(Name = "LocalizableStrings", UsageType = DesignModeUsageType.None, MetaPropertyName = "B2", ForeignPackageEditMode = ForeignPackageEditMode.ItemsAdd | ForeignPackageEditMode.ItemsMove)]
[DesignModeProperty(Name = "Usings", UsageType = DesignModeUsageType.None, MetaPropertyName = "B3", ForeignPackageEditMode = ForeignPackageEditMode.ItemsAdd | ForeignPackageEditMode.ItemsMove)]
[DesignModeProperty(Name = "DenyExtending", MetaPropertyName = "B9")]
[DesignModeProperty(Name = "ExtendParent", MetaPropertyName = "B7", IsReadOnly = true)]
[DesignModeProperty(Name = "PackageUId", UsageType = DesignModeUsageType.General, IsRequired = true, MetaPropertyName = "B6", ValuesProvider = "PackageUIdValuesProvider")]
[DesignModeProperty(Name = "CreatedInVersion", MetaPropertyName = "B8", IsReadOnly = true, UsageType = DesignModeUsageType.None)]
public abstract class Schema : MetaSchema, IMetaDataSerializable, ICloneable, IMetaSchema, IMetaItem, IManagerItemInstance
Constructors
Schema(ISchemaManager)
Initializes a new Schema instance with the specified schema manager.
Declaration
protected Schema(ISchemaManager schemaManager)
Parameters
Type | Name | Description |
---|---|---|
ISchemaManager | schemaManager | Schema manager. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Schema(Schema)
Initializes a new instance of the Schema that is a clone of the given schema source
.
Declaration
protected Schema(Schema source)
Parameters
Type | Name | Description |
---|---|---|
Schema | source | Schema, which clone is created. |
Properties
AppManagerProvider
Provider of application-level schema manager.
Declaration
public ManagerProvider AppManagerProvider { get; }
Property Value
Type | Description |
---|---|
ManagerProvider |
Caption
Schema header.
Declaration
[DBMetaTypeProperty(DBMetaInfoItemType.Schema, typeof(LocalizableStringDBMetaTypeConverter))]
[MetaTypeProperty("{C71EEECC-9C0D-4fe6-9401-44E3BBF10493}", "Terrasoft.Core", "Schema.Caption")]
public LocalizableString Caption { get; set; }
Property Value
Type | Description |
---|---|
LocalizableString |
CreatedInVersion
Created in the product version.
Declaration
[MetaTypeProperty("{A4E12596-007E-4B27-9460-AAB24E2D876D}", DefValue = "", IsExtraProperty = true)]
public string CreatedInVersion { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DenyExtending
Forbid the substitution.
Declaration
public bool DenyExtending { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Description
Description of the schema.
Declaration
public LocalizableString Description { get; set; }
Property Value
Type | Description |
---|---|
LocalizableString |
ExtendParent
Flag indicates whether current schema extend its parent schema.
Declaration
public virtual bool ExtendParent { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
HasMethods
A sign that the schema has methods.
Declaration
public bool HasMethods { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsAggregated
Declaration
public bool IsAggregated { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsCoreSchema
Flag if the schema is a system schema.
Declaration
public bool IsCoreSchema { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsInitialized
Determines if the schema is initialized.
Declaration
public bool IsInitialized { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsStaticContentNotGenerated
Indicates that static content was not generated.
Declaration
public bool IsStaticContentNotGenerated { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ItemsSequentiallyNumbered
Flag of generation a sequential schema name.
Declaration
public virtual bool ItemsSequentiallyNumbered { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LocalizableStrings
Collection of localizable schema strings.
Declaration
[MetaTypeProperty("{53B29047-2FA9-4009-BF8C-113B7EA1F2E5}")]
public SchemaLocalizableStringCollection LocalizableStrings { get; }
Property Value
Type | Description |
---|---|
SchemaLocalizableStringCollection |
ManagerItem
Schema view.
Declaration
public IManagerItem ManagerItem { get; set; }
Property Value
Type | Description |
---|---|
IManagerItem |
Methods
Collection of methods of the schema.
Declaration
[MetaTypeProperty("{CF300D60-27A1-4C44-BF0D-AE2C3372EF2E}")]
public SchemaMethodCollection Methods { get; }
Property Value
Type | Description |
---|---|
SchemaMethodCollection |
PackageUId
Unique identifier of a package.
Declaration
public Guid PackageUId { get; set; }
Property Value
Type | Description |
---|---|
System.Guid |
ReferenceSchemaUIds
A collection of schema identifiers referenced by the schema.
Declaration
public Collection<Guid> ReferenceSchemaUIds { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<System.Guid> |
ResourceManager
Schema resource manager.
Declaration
public IResourceManager ResourceManager { get; set; }
Property Value
Type | Description |
---|---|
IResourceManager |
SchemaManager
Schema manager.
Declaration
public ISchemaManager SchemaManager { get; }
Property Value
Type | Description |
---|---|
ISchemaManager |
SchemaManagerItem
Schema view.
Declaration
public ISchemaManagerItem SchemaManagerItem { get; set; }
Property Value
Type | Description |
---|---|
ISchemaManagerItem |
SchemaManagerProvider
The provider of the configuration level schema manager.
Declaration
public SchemaManagerProvider SchemaManagerProvider { get; }
Property Value
Type | Description |
---|---|
SchemaManagerProvider |
SchemaNamePrefix
The prefix of the name of the object.
Declaration
public string SchemaNamePrefix { get; }
Property Value
Type | Description |
---|---|
System.String |
Storage
Schema resource store.
Declaration
public IResourceStorage Storage { get; }
Property Value
Type | Description |
---|---|
IResourceStorage |
SystemUserConnection
System user connection.
Declaration
public UserConnection SystemUserConnection { get; }
Property Value
Type | Description |
---|---|
UserConnection |
Usings
Collection of namespaces used by schema.
Declaration
[MetaTypeProperty("{CAF30A49-B813-43FD-8D7F-0C46E72FA2D3}")]
public SchemaUsingCollection Usings { get; }
Property Value
Type | Description |
---|---|
SchemaUsingCollection |
Workspace
Declaration
protected SysWorkspace Workspace { get; }
Property Value
Type | Description |
---|---|
SysWorkspace |
Methods
ApplyMetaDataValue(DataReader)
Proofreading the values of the schema properties from the metadata using the specified DataReader.
Declaration
protected override void ApplyMetaDataValue(DataReader reader)
Parameters
Type | Name | Description |
---|---|---|
DataReader | reader | The DataReader instance that provides metadata proofreading. |
Overrides
FindItem<T>(T, IEnumerable<Func<T, MetaItem>>)
Declaration
protected static MetaItem FindItem<T>(T arg, IEnumerable<Func<T, MetaItem>> methods)
Parameters
Type | Name | Description |
---|---|---|
T | arg | |
System.Collections.Generic.IEnumerable<System.Func<T, MetaItem>> | methods |
Returns
Type | Description |
---|---|
MetaItem |
Type Parameters
Name | Description |
---|---|
T |
GenerateItemCaption(DesignModeClassDescriptor, Int32)
Generates a sequential schema header using the specified index and the class definition of the development time object.
Declaration
public LocalizableString GenerateItemCaption(DesignModeClassDescriptor classDescriptor, int index)
Parameters
Type | Name | Description |
---|---|---|
DesignModeClassDescriptor | classDescriptor | Description of the class of the development time object. |
System.Int32 | index | Schema index. |
Returns
Type | Description |
---|---|
LocalizableString | Localizable string of the schema caption. |
GenerateItemNamePrefix(IDesignItem, DesignModeClassDescriptor)
A prefix is generated for a given development time element, using the specified description of the class of the development time object.
Declaration
protected string GenerateItemNamePrefix(IDesignItem item, DesignModeClassDescriptor classDescriptor)
Parameters
Type | Name | Description |
---|---|---|
IDesignItem | item | The development time element. |
DesignModeClassDescriptor | classDescriptor | Description of the class of the development time object. |
Returns
Type | Description |
---|---|
System.String | Generated prefix for the |
GenerateItemUniqueIndex(String)
Generates the unique index of the item for the specified prefix.
Declaration
public virtual int GenerateItemUniqueIndex(string prefix)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | Prefix. |
Returns
Type | Description |
---|---|
System.Int32 | Unique index of the item for the |
Remarks
The method is not implemented.
GetIsNamePrefixValid(String)
Checks if the prefix of the object name matches the prefix specified in the "Prefix for object name” system setting .
Declaration
public virtual bool GetIsNamePrefixValid(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Object name. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetIsPrefixRequired()
Declaration
protected virtual bool GetIsPrefixRequired()
Returns
Type | Description |
---|---|
System.Boolean |
GetLocalizableValues(ICollection<LocalizableValue>)
Loads the localized values of the schema into the specified collection.
Declaration
public virtual void GetLocalizableValues(ICollection<LocalizableValue> values)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<LocalizableValue> | values | A collection of returned localizable schema values. |
GetLocalizableValues(ICollection<LocalizableValue>, Boolean)
Loads the localized values of the schema into the specified collection.
Declaration
public virtual void GetLocalizableValues(ICollection<LocalizableValue> values, bool includeInherited)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<LocalizableValue> | values | A collection of returned localizable schema values. |
System.Boolean | includeInherited | Whether to include properties in the collection of returned localizable values inherited (“no” by default). |
GetMetaItems(ICollection<IMetaItem>)
Fills the passed collection with meta items of the current schema.
Declaration
public virtual void GetMetaItems(ICollection<IMetaItem> metaItems)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<IMetaItem> | metaItems | Collection that is populated with meta items of the current schema. |
GetParentRealUIds(Collection<Guid>)
Declaration
public virtual void GetParentRealUIds(Collection<Guid> realUIds)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.Collection<System.Guid> | realUIds |
GetResourceManagerName()
Declaration
public override string GetResourceManagerName()
Returns
Type | Description |
---|---|
System.String |
Overrides
GetSchemaReferences()
Gets a collection of references to assemblies that are required to compile the schema.
Declaration
public virtual CodeCompilerReferenceCollection GetSchemaReferences()
Returns
Type | Description |
---|---|
CodeCompilerReferenceCollection | Collection of references to the assembly that are needed to compile the schema. |
GetShemaResourceManagerName(Guid)
Declaration
public static string GetShemaResourceManagerName(Guid schemaRealUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | schemaRealUId |
Returns
Type | Description |
---|---|
System.String |
HandleNameChanging(String)
Updates the names of all localizable properties of the schema when it is renamed.
Declaration
public override void HandleNameChanging(string oldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | oldName | Schema old name. |
Overrides
InitializeLocalizableStrings()
Initialization of localized schema lines.
Declaration
protected virtual void InitializeLocalizableStrings()
InitializeLocalizableValues()
Initializes the localized values of the schema.
Declaration
public void InitializeLocalizableValues()
InitializeLocalizableValues(String)
Initializes schema localizable values.
Declaration
public virtual void InitializeLocalizableValues(string resourceManagerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceManagerName | Resource manager name. |
InitializeLocalizableValues(String, String)
Performs initialization of localized schema values from the specified group of the specified resource manager.
Declaration
public virtual void InitializeLocalizableValues(string resourceManagerName, string resourceGroupName)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceManagerName | Name of a resource manager. |
System.String | resourceGroupName | Resource group name. |
InitializeMethods()
Initialization of the schema methods.
Declaration
protected virtual void InitializeMethods()
InitializePrimaryInfo()
Initializes primary properties of the schema.
Declaration
public virtual void InitializePrimaryInfo()
InitializeUsings()
Initialization of the namespace collections used by the schema.
Declaration
protected virtual void InitializeUsings()
LoadLocalizableValues()
Loads values for localized schema elements.
Declaration
public virtual void LoadLocalizableValues()
ReInitializeLocalizableValues(String, String)
Performs reinitialization of localized schema values from the specified group of the specified resource manager.
Declaration
public virtual void ReInitializeLocalizableValues(string resourceManagerName, string resourceGroupName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | resourceManagerName | Resource manager name. |
System.String | resourceGroupName | Resource group name. |
RenameLocalizedProperty(String, IMetaItem)
Updates the name of the specified localizable schema property when the schema is renamed.
Declaration
public void RenameLocalizedProperty(string oldName, IMetaItem childProperty)
Parameters
Type | Name | Description |
---|---|---|
System.String | oldName | The old schema name. |
IMetaItem | childProperty | A localizable schema property. |
SetDefInheritance()
Sets the current schema identifier as the parent for all schema elements that do not have a parent schema identifier.
Declaration
public virtual void SetDefInheritance()
SetLocalizableStringsDefInheritance()
The schema sets inheritance properties for localized strings.
Declaration
protected void SetLocalizableStringsDefInheritance()
SetLocalizedPropertyValue(String, IMetaItem, String, String)
Declaration
public void SetLocalizedPropertyValue(string culture, IMetaItem childProperty, string propertyName, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | culture | |
IMetaItem | childProperty | |
System.String | propertyName | |
System.String | value |
SetMethodsDefInheritance()
Declaration
protected void SetMethodsDefInheritance()
SetUniqueNameAndCaptionForItem(IDesignItem)
Sets a unique name and a title for a given development time element.
Declaration
public void SetUniqueNameAndCaptionForItem(IDesignItem item)
Parameters
Type | Name | Description |
---|---|---|
IDesignItem | item | The development time element, to which the name and title are set. |
Remarks
Overloaded method.
SetUniqueNameAndCaptionForItem(IDesignItem, DesignModeClassDescriptor, Int32)
Sets a unique name and header for a given development time element, with the specified index and a description of the development time object class.
Declaration
public virtual void SetUniqueNameAndCaptionForItem(IDesignItem item, DesignModeClassDescriptor classDescriptor, int index)
Parameters
Type | Name | Description |
---|---|---|
IDesignItem | item | The development time element, to which the name and title are set. |
DesignModeClassDescriptor | classDescriptor | Description of the class of the development time object |
System.Int32 | index | Element index. |
Remarks
Overloaded method.
SetUniqueNameAndCaptionForItem<TItemType>(TItemType, MetaItemCollection<TItemType>)
Sets a unique name and a title for a development time element of a specified type, from the passed collection.
Declaration
public void SetUniqueNameAndCaptionForItem<TItemType>(TItemType item, MetaItemCollection<TItemType> items)
where TItemType : class, IMetaItem
Parameters
Type | Name | Description |
---|---|---|
TItemType | item | The development time element, to which the name and title are set. |
MetaItemCollection<TItemType> | items | A collection of design-time elements to which the |
Type Parameters
Name | Description |
---|---|
TItemType | The type of the development time element. |
Remarks
Overloaded method.
WriteMetaData(DataWriter)
Records schema metadata using the DataWriter instance.
Declaration
public override void WriteMetaData(DataWriter writer)
Parameters
Type | Name | Description |
---|---|---|
DataWriter | writer | The DataWriter instance that writes schema metadata. |