Class SimpleContentType
Implements ISimpleContentType.
Inheritance
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public class SimpleContentType : ISimpleContentType
Constructors
View SourceSimpleContentType(IContentType)
Initializes a new instance of the SimpleContentType class.
Declaration
public SimpleContentType(IContentType contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| IContentType | contentType |
SimpleContentType(IMediaType)
Initializes a new instance of the SimpleContentType class.
Declaration
public SimpleContentType(IMediaType mediaType)
Parameters
| Type | Name | Description |
|---|---|---|
| IMediaType | mediaType |
SimpleContentType(IMemberType)
Initializes a new instance of the SimpleContentType class.
Declaration
public SimpleContentType(IMemberType memberType)
Parameters
| Type | Name | Description |
|---|---|---|
| IMemberType | memberType |
Properties
View SourceAlias
Gets the alias of the content type.
Declaration
public string Alias { get; }
Property Value
| Type | Description |
|---|---|
| string |
AllowedAsRoot
Gets a value indicating whether content of that type can be created at the root of the tree.
Declaration
public bool AllowedAsRoot { get; }
Property Value
| Type | Description |
|---|---|
| bool |
DefaultTemplate
Gets the default template of the content type.
Declaration
public ITemplate? DefaultTemplate { get; }
Property Value
| Type | Description |
|---|---|
| ITemplate |
Icon
Gets the icon of the content type.
Declaration
public string? Icon { get; }
Property Value
| Type | Description |
|---|---|
| string |
Id
Declaration
public int Id { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsElement
Gets a value indicating whether the content type is an element content type.
Declaration
public bool IsElement { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Key
Declaration
public Guid Key { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
ListView
Gets the list view of the content type.
Declaration
public Guid? ListView { get; }
Property Value
| Type | Description |
|---|---|
| Guid? |
Name
Declaration
public string? Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Variations
Gets the content variation of the content type.
Declaration
public ContentVariation Variations { get; }
Property Value
| Type | Description |
|---|---|
| ContentVariation |
Methods
View SourceEquals(object?)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Equals(SimpleContentType)
Declaration
protected bool Equals(SimpleContentType other)
Parameters
| Type | Name | Description |
|---|---|---|
| SimpleContentType | other |
Returns
| Type | Description |
|---|---|
| bool |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
SupportsPropertyVariation(string?, string, bool)
Validates that a combination of culture and segment is valid for the content type properties.
Declaration
public bool SupportsPropertyVariation(string? culture, string segment, bool wildcards = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture | The culture. |
| string | segment | The segment. |
| bool | wildcards | A value indicating whether wildcard are supported. |
Returns
| Type | Description |
|---|---|
| bool | True if the combination is valid; otherwise false. |
Remarks
The combination must be valid for properties of the content type. For instance, if the content type varies by culture, then an invariant culture is valid, because some properties may be invariant. On the other hand, if the content type is invariant, then a variant culture is invalid, because no property could possibly vary by culture.