Class PropertyMedia<T>
A property to use for using a media from ImageVault.
Namespace: ImageVault.EPiServer
Assembly: ImageVault.EPiServer.dll
Syntax
public abstract class PropertyMedia<T> : PropertyData where T : MediaReference, new()
Type Parameters
Name | Description |
---|---|
T | The type of MediaReference that should be stored in the property. Needs to inherit the MediaReference class. |
Examples
public class MyMedia : MediaReference {
//Add your custom implementation here
}
[PageDefinitionTypePlugIn(DisplayName = "MyMedia")]
public class PropertyMyMedia : PropertyMedia<MyMedia> {}
Constructors
PropertyMedia()
Initializes a new instance of the PropertyMedia class.
Declaration
protected PropertyMedia()
PropertyMedia(T)
Initializes a new instance of the PropertyMedia<T> class.
Declaration
protected PropertyMedia(T mediaReference)
Parameters
Type | Name | Description |
---|---|---|
T | mediaReference |
Properties
IsModified
Get/Sets the IsModified of the PropertyMedia
Declaration
public override bool IsModified { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsNull
Gets the IsNull of the PropertyMedia
Declaration
public override bool IsNull { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MediaReference
Get/Sets the MediaReference of the PropertyMedia
Declaration
public T MediaReference { get; set; }
Property Value
Type | Description |
---|---|
T |
PropertyValueType
Gets the PropertyValueType of the PropertyMedia
Declaration
public override Type PropertyValueType { get; }
Property Value
Type | Description |
---|---|
System.Type | Is always the |
Type
Gets the Type of the PropertyMedia
Declaration
public override PropertyDataType Type { get; }
Property Value
Type | Description |
---|---|
EPiServer.Core.PropertyDataType | Is always a EPiServer.Core.PropertyDataType.LongString. Will serialize its value as a Json string. |
Value
Get/Sets the Value of the PropertyMedia
Declaration
public override object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object | Is always of the type |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the value passed to the setter isn't of the correct type or a non parseable string. |
System.NotSupportedException | If setter is called and the property is EPiServer.Core.PropertyData.IsReadOnly |
Methods
Copy()
Creates a copy of the current PropertyData object
Declaration
public override PropertyData Copy()
Returns
Type | Description |
---|---|
EPiServer.Core.PropertyData | A copy of the current instance |
CreateWritableClone()
Creates a new object that is a copy of the current instance.
Declaration
public override PropertyData CreateWritableClone()
Returns
Type | Description |
---|---|
EPiServer.Core.PropertyData | A new object that is a copy of this instance. |
MakeReadOnly()
Makes the instance readonly
Declaration
public override void MakeReadOnly()
ParseToSelf(String)
Declaration
public override void ParseToSelf(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value |
SaveData(PropertyDataCollection)
Declaration
public override object SaveData(PropertyDataCollection properties)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Core.PropertyDataCollection | properties |
Returns
Type | Description |
---|---|
System.Object |
SetDefaultValue()
Declaration
protected override void SetDefaultValue()