Appearance
CreateType Method
Definition
- Namespace:
JASE.Reflection - Assembly:
JASE.ReflectionTools.dll
Overloads
| Name | Description |
|---|---|
Type CreateType(string name, Dictionary<string, Type> properties, Type[] implements = null, bool dataContract = null, bool autoVersioning = null) | Creates a dynamic Type with the specified name, properties and optionally implements one or more interfaces. |
Type CreateType(string name, IList<PropertyAttribute> attributes, IList<Property> properties, Type[] implements = null, bool dataContract = null, Type inheritsFrom = null, bool autoVersioning = null) | Creates a new dynamic Type with the specified name and properties. |
Type CreateType(string name, Dictionary<string, Type> properties, Type[] implements = null, bool dataContract = null, bool autoVersioning = null)
csharp
Type CreateType(string name, Dictionary<string, Type> properties, Type[] implements = null, bool dataContract = null, bool autoVersioning = null)Creates a dynamic Type with the specified name, properties and optionally implements one or more interfaces.
Parameters
| Name | Description |
|---|---|
autoVersioning | An optional flag indicating whether to automatically version the dynamic Type by adding a version number to its name if a Type with the same name already exists. |
dataContract | An optional flag indicating whether to add a DataContract attribute to the dynamic Type and its properties. |
implements | An optional array of interfaces to be implemented by the dynamic Type. |
name | The name of the dynamic Type. |
properties | A dictionary containing the name and Type of each property to be added to the Type. |
Returns
The created dynamic Type.
Type CreateType(string name, IList<PropertyAttribute> attributes, IList<Property> properties, Type[] implements = null, bool dataContract = null, Type inheritsFrom = null, bool autoVersioning = null)
csharp
Type CreateType(string name, IList<PropertyAttribute> attributes, IList<Property> properties, Type[] implements = null, bool dataContract = null, Type inheritsFrom = null, bool autoVersioning = null)Creates a new dynamic Type with the specified name and properties.
Parameters
| Name | Description |
|---|---|
attributes | A list of custom attributes to be applied to the Type. |
autoVersioning | Specifies whether to automatically version the new Type if a Type with the same name already exists. |
dataContract | Specifies whether the new Type will have a DataContractAttribute. |
implements | An array of Type objects that the new Type will implement. |
inheritsFrom | The Type that the new Type will inherit from. |
name | The name of the new Type to be created. |
properties | A list of properties to be defined on the Type. |
Returns
A new Type with the specified name and properties.