November Happy Hour will be moved to Thursday December 5th.

Class ProjectItem

A project item is content that is linked to a project

Inheritance
System.Object
ProjectItem
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 10.10.4
Syntax
public class ProjectItem : IReadOnly<ProjectItem>, IReadOnly

Constructors

ProjectItem()

Default constructor

Declaration
public ProjectItem()

ProjectItem(Int32, IContent)

Constructor for a referenced content

Declaration
public ProjectItem(int projectId, IContent content)
Parameters
Type Name Description
System.Int32 projectId

Id of the project

IContent content

Referenced content

Fields

DefaultCategory

Declaration
public const string DefaultCategory = ""
Field Value
Type Description
System.String

Properties

Category

The category of the content

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

The linked content item

Declaration
public ContentReference ContentLink { get; set; }
Property Value
Type Description
ContentReference

ID

The identity of the project item

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

Language

The language of the linked content

Declaration
public CultureInfo Language { get; set; }
Property Value
Type Description
System.Globalization.CultureInfo

ProjectID

The identity of the project

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

Methods

CreateWritableClone()

Declaration
public ProjectItem CreateWritableClone()
Returns
Type Description
ProjectItem

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.

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