Class MediaType
Represents the content type that a Media object is based on
Inheritance
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[DataContract(IsReference = true)]
public class MediaType : ContentTypeCompositionBase, IMediaType, IContentTypeComposition, IContentTypeBase, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceMediaType(IShortStringHelper, Int32)
Constuctor for creating a MediaType with the parent's id.
Declaration
public MediaType(IShortStringHelper shortStringHelper, int parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| IShortStringHelper | shortStringHelper | |
| System.Int32 | parentId |
Remarks
Only use this for creating MediaTypes at the root (with ParentId -1).
MediaType(IShortStringHelper, IMediaType)
Constuctor for creating a MediaType with the parent as an inherited type.
Declaration
public MediaType(IShortStringHelper shortStringHelper, IMediaType parent)
Parameters
| Type | Name | Description |
|---|---|---|
| IShortStringHelper | shortStringHelper | |
| IMediaType | parent |
Remarks
Use this to ensure inheritance from parent.
MediaType(IShortStringHelper, IMediaType, String)
Constuctor for creating a MediaType with the parent as an inherited type.
Declaration
public MediaType(IShortStringHelper shortStringHelper, IMediaType parent, string alias)
Parameters
| Type | Name | Description |
|---|---|---|
| IShortStringHelper | shortStringHelper | |
| IMediaType | parent | |
| System.String | alias |
Remarks
Use this to ensure inheritance from parent.
Fields
View SourceSupportsPublishingConst
Declaration
public const bool SupportsPublishingConst = false
Field Value
| Type | Description |
|---|---|
| System.Boolean |
Properties
View SourceAlias
The Alias of the ContentType
Declaration
public override string Alias { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
SupportsPublishing
Gets a value indicating whether the content type supports publishing.
Declaration
public override bool SupportsPublishing { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
A publishing content type supports draft and published values for properties. It is possible to retrieve either the draft (default) or published value of a property. Setting the value always sets the draft value, which then needs to be published.
A non-publishing content type only supports one value for properties. Getting the draft or published value of a property returns the same thing, and publishing a value property has no effect.
Methods
View SourceToSimple()
Gets an ISimpleContentType corresponding to this content type.
Declaration
public override ISimpleContentType ToSimple()
Returns
| Type | Description |
|---|---|
| ISimpleContentType |
Explicit Interface Implementations
View SourceIMediaType.DeepCloneWithResetIdentities(String)
Creates a deep clone of the current entity with its identity/alias and it's property identities reset
Declaration
IMediaType IMediaType.DeepCloneWithResetIdentities(string newAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | newAlias |
Returns
| Type | Description |
|---|---|
| IMediaType |