SaaS CMS has officially launched! Learn more now.

Class PropertyDefinitionType

Read and save property definition types, used by property definitions to specify which type that handles a specific property.

Inheritance
System.Object
PropertyDefinitionType
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
public class PropertyDefinitionType : Object, IReadOnly<PropertyDefinitionType>, IReadOnly

Constructors

PropertyDefinitionType()

Initializes a new instance of the PropertyDefinitionType class.

Declaration
public PropertyDefinitionType()

PropertyDefinitionType(Int32, PropertyDataType, String)

Initializes a new instance of the PropertyDefinitionType class and sets some default properties.

Declaration
public PropertyDefinitionType(int id, PropertyDataType type, string name)
Parameters
Type Name Description
System.Int32 id

The unique identifier of type.

PropertyDataType type

The actual data type used by this type

System.String name

The name of the data type

PropertyDefinitionType(Int32, PropertyDataType, String, String, String)

Initializes a new instance of the PropertyDefinitionType class and sets some default properties.

Declaration
public PropertyDefinitionType(int id, PropertyDataType type, string name, string typeName, string assemblyName)
Parameters
Type Name Description
System.Int32 id

The unique identifier of type.

PropertyDataType type

The actual data type used by this type

System.String name

The name of the data type

System.String typeName

The full class name used to create a instance of this type

System.String assemblyName

The assembly used to create a instance of this type

Properties

AssemblyName

The assembly used to create a instance of this type

Declaration
public string AssemblyName { get; set; }
Property Value
Type Description
System.String

ContentTypeRepository

Gets or sets the content type repository that should be used by this instance.

Declaration
public Injected<IContentTypeRepository> ContentTypeRepository { get; set; }
Property Value
Type Description
Injected<IContentTypeRepository>

DataType

The actual data type used by this type

Declaration
public virtual PropertyDataType DataType { get; set; }
Property Value
Type Description
PropertyDataType

DefinitionType

Gets the System.Type for the definition type.

Declaration
public Type DefinitionType { get; }
Property Value
Type Description
System.Type

The definition type.

GUID

Gets or sets the optional globally unique identifier for this property definition type instance.

Declaration
public Nullable<Guid> GUID { get; set; }
Property Value
Type Description
System.Nullable<System.Guid>

ID

The unique identifier of type

Declaration
public int ID { get; set; }
Property Value
Type Description
System.Int32

IsReadOnly

Indicates whether the current object instance is read-only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean

LocalizationService

Gets or sets the localization service that should be used by this instance.

Declaration
public Injected<LocalizationService> LocalizationService { get; set; }
Property Value
Type Description
Injected<LocalizationService>

LocalizedName

The localized name of the data type

Declaration
public string LocalizedName { get; }
Property Value
Type Description
System.String

Name

The name of the data type

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

TypeName

The full class name used to create a instance of this type

Declaration
public string TypeName { get; set; }
Property Value
Type Description
System.String

Methods

CreateWritableClone()

Declaration
public PropertyDefinitionType CreateWritableClone()
Returns
Type Description
PropertyDefinitionType

IsSystemType()

Determines whether this page definition type is a built in system type.

Declaration
public bool IsSystemType()
Returns
Type Description
System.Boolean

true if this page definition type is a built in system type; otherwise, false.

MakeReadOnly()

Changes the object instance into a read-only object.

Declaration
public void MakeReadOnly()
Remarks

After calling this method, any attempt to change the object instance or any contained object will generate a System.NotSupportedException. I.e. the semantics is "deep read-only".

Note! After setting an object to read-only it is not possible to revert back to read-write mode. You will have to call the CreateWritableClone method to get a copy that can be modified.

ResolvePropertyDataType(PropertyDataType)

Resolves the given PropertyDataType to a System.Type.

Declaration
public static Type ResolvePropertyDataType(PropertyDataType dataType)
Parameters
Type Name Description
PropertyDataType dataType

The data type to resolve into a Type.

Returns
Type Description
System.Type

A System.Type that matches the provided type.

Remarks

If the dataType is a Block a property with an untyped BlockData will be returned.

ThrowIfReadOnly()

Declaration
protected virtual void ThrowIfReadOnly()

Explicit Interface Implementations

IReadOnly.CreateWritableClone()

Creates a writable copy of the current object.

Declaration
object IReadOnly.CreateWritableClone()
Returns
Type Description
System.Object

A writable copy of the current object.

Remarks

The cloning is a deep-copy.

Implements

Extension Methods