Class ContentEventArgs

Event arguments used when content is loaded, saved etc.

Inherited Members
System.EventArgs.Empty
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
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public class ContentEventArgs : EventArgs

Constructors

ContentEventArgs(ContentReference)

Initializes a new instance of the ContentEventArgs class.

Declaration
public ContentEventArgs(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link the event applies to.

ContentEventArgs(ContentReference, ContentReference)

Initializes a new instance of the ContentEventArgs class.

Declaration
public ContentEventArgs(ContentReference contentLink, ContentReference targetLink)
Parameters
Type Name Description
ContentReference contentLink

The source content link.

ContentReference targetLink

The target content link.

Remarks

Primarily used for move operations where you have a source and target.

ContentEventArgs(ContentReference, IContent)

Initializes a new instance of the ContentEventArgs class.

Declaration
public ContentEventArgs(ContentReference contentLink, IContent content)
Parameters
Type Name Description
ContentReference contentLink

The content link.

IContent content

The content.

ContentEventArgs(ContentReference, IContent, AccessLevel)

Initializes a new instance of the ContentEventArgs class.

Declaration
public ContentEventArgs(ContentReference contentLink, IContent content, AccessLevel requiredAccess)
Parameters
Type Name Description
ContentReference contentLink

The content link.

IContent content

The content.

AccessLevel requiredAccess

The required access level for the operation.

ContentEventArgs(IContent)

Initializes a new instance of the ContentEventArgs class.

Declaration
public ContentEventArgs(IContent content)
Parameters
Type Name Description
IContent content

The content that the event applies to.

Properties

CancelAction

Set value to abort the current event handling

Declaration
public bool CancelAction { get; set; }
Property Value
Type Description
System.Boolean
Remarks

Changing this value may not always change the behavior, see the specific event for details.

CancelReason

Gets or sets the reason for cancel.

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

The cancel reason.

Remarks

If the cancellation results in an EPiServerCancelAction, this string will be used as the message in the exception.

Content

The content that the event applies to

Declaration
public IContent Content { get; set; }
Property Value
Type Description
IContent
Remarks

Changing this object may not always change the behavior, see the specific event for details.

The Content that the event applies to

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

Changing this object may not always change the behavior, see the specific event for details.

Creator

This property keeps track of the class/instance that created the page object.

Declaration
public object Creator { get; set; }
Property Value
Type Description
System.Object
Remarks

Note that this property should only be set if you are creating a new PageData instance, not if you are just updating information in an existing object.

Items

Gets a key-value collection that can be used to organize and share data between events handlers during an event chain.

Declaration
public IDictionary Items { get; }
Property Value
Type Description
System.Collections.IDictionary

RequiredAccess

The required access that the event applies to.

Declaration
public AccessLevel RequiredAccess { get; set; }
Property Value
Type Description
AccessLevel
Remarks

This applies to the destination access if both source and destination are applicable.

The parent that the event applies to

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

Changing this object may not always change the behavior, see the specific event for details.

Extension Methods