Class MemberType
Represents the content type that a Member object is based on
Inheritance
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[DataContract(IsReference = true)]
public class MemberType : ContentTypeCompositionBase, IMemberType, IContentTypeComposition, IContentTypeBase, IUmbracoEntity, ITreeEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceMemberType(IShortStringHelper, int)
Initializes a new instance of the MemberType class with the specified parent ID.
Declaration
public MemberType(IShortStringHelper shortStringHelper, int parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| IShortStringHelper | shortStringHelper | The short string helper. |
| int | parentId | The identifier of the parent content type. |
MemberType(IShortStringHelper, IContentTypeComposition)
Initializes a new instance of the MemberType class with a parent content type.
Declaration
public MemberType(IShortStringHelper shortStringHelper, IContentTypeComposition parent)
Parameters
| Type | Name | Description |
|---|---|---|
| IShortStringHelper | shortStringHelper | The short string helper. |
| IContentTypeComposition | parent | The parent content type composition. |
MemberType(IShortStringHelper, IContentTypeComposition, string)
Initializes a new instance of the MemberType class with a parent content type and alias.
Declaration
public MemberType(IShortStringHelper shortStringHelper, IContentTypeComposition parent, string alias)
Parameters
| Type | Name | Description |
|---|---|---|
| IShortStringHelper | shortStringHelper | The short string helper. |
| IContentTypeComposition | parent | The parent content type composition. |
| string | alias | The alias for the member type. |
Fields
View SourceSupportsPublishingConst
Constant indicating that member types do not support publishing.
Declaration
public const bool SupportsPublishingConst = false
Field Value
| Type | Description |
|---|---|
| bool |
Properties
View SourceAlias
The Alias of the ContentType
Declaration
[DataMember]
public override string Alias { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SupportsPublishing
Gets a value indicating whether the content type supports publishing.
Declaration
public override bool SupportsPublishing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
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.
Variations
Gets or sets the content variation mode. Always returns Nothing for members.
Declaration
public override ContentVariation Variations { get; set; }
Property Value
| Type | Description |
|---|---|
| ContentVariation |
Remarks
Although technically possible, variations on members don't make much sense and therefore are disabled. They are fully supported at service level, though, but not at published snapshot level.
Methods
View SourceIsSensitiveProperty(string)
Gets a boolean indicating whether a Property is marked as storing sensitive values on the Members profile.
Declaration
public bool IsSensitiveProperty(string propertyTypeAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyTypeAlias | PropertyType Alias of the Property to check |
Returns
| Type | Description |
|---|---|
| bool |
MemberCanEditProperty(string?)
Gets a boolean indicating whether a Property is editable by the Member.
Declaration
public bool MemberCanEditProperty(string? propertyTypeAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyTypeAlias | PropertyType Alias of the Property to check |
Returns
| Type | Description |
|---|---|
| bool |
MemberCanViewProperty(string)
Gets a boolean indicating whether a Property is visible on the Members profile.
Declaration
public bool MemberCanViewProperty(string propertyTypeAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyTypeAlias | PropertyType Alias of the Property to check |
Returns
| Type | Description |
|---|---|
| bool |
SetIsSensitiveProperty(string, bool)
Sets a boolean indicating whether a Property is a sensitive value on the Members profile.
Declaration
public void SetIsSensitiveProperty(string propertyTypeAlias, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyTypeAlias | PropertyType Alias of the Property to set |
| bool | value | Boolean value, true or false |
SetMemberCanEditProperty(string, bool)
Sets a boolean indicating whether a Property is editable by the Member.
Declaration
public void SetMemberCanEditProperty(string propertyTypeAlias, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyTypeAlias | PropertyType Alias of the Property to set |
| bool | value | Boolean value, true or false |
SetMemberCanViewProperty(string, bool)
Sets a boolean indicating whether a Property is visible on the Members profile.
Declaration
public void SetMemberCanViewProperty(string propertyTypeAlias, bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyTypeAlias | PropertyType Alias of the Property to set |
| bool | value | Boolean value, true or false |
ToSimple()
Converts this content type to a simple content type representation.
Declaration
public override ISimpleContentType ToSimple()
Returns
| Type | Description |
|---|---|
| ISimpleContentType | A simple content type representation. |