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

Class PropertyDefinitionRepository

Repository for the PropertyDefinition data structure.

Inheritance
System.Object
PropertyDefinitionRepository
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 abstract class PropertyDefinitionRepository : IPropertyDefinitionRepository

Constructors

PropertyDefinitionRepository()

Declaration
protected PropertyDefinitionRepository()

Methods

CheckUsage(Int32, Boolean, Boolean, Boolean)

Checks the usage.

Declaration
public abstract bool CheckUsage(int propertyDefinitionID, bool onlyLanguageSpecific, bool onlyPublished, bool isDynamic)
Parameters
Type Name Description
System.Int32 propertyDefinitionID

The property definition ID.

System.Boolean onlyLanguageSpecific

if set to true [only language specific].

System.Boolean onlyPublished

if set to true [only published].

System.Boolean isDynamic

if set to true [is dynamic].

Returns
Type Description
System.Boolean

Delete(PropertyDefinition)

Deletes a PropertyDefinition from the data repository.

Declaration
public abstract void Delete(PropertyDefinition propertyDefinition)
Parameters
Type Name Description
PropertyDefinition propertyDefinition

The PropertyDefinition to delete.

ExistsPropertyDefinitionWithContentType(Guid)

Determines whether there is any property definition of the specified content type.

Declaration
public abstract bool ExistsPropertyDefinitionWithContentType(Guid contentTypeID)
Parameters
Type Name Description
System.Guid contentTypeID

The content type ID.

Returns
Type Description
System.Boolean

true if there is a property definition of the specified type; otherwise, false.

Remarks

An example would be if there is a page type that has a property definition of a block with the specified id (contentTypeID)

GetUsage(Int32, Boolean, Boolean, Boolean)

Retrieves information about the usage of the PropertyDefinition.

Declaration
public abstract IEnumerable<ContentUsage> GetUsage(int propertyDefinitionID, bool onlyLanguageSpecific, bool onlyPublished, bool isDynamic)
Parameters
Type Name Description
System.Int32 propertyDefinitionID

The property definition ID.

System.Boolean onlyLanguageSpecific

if set to true only language specific usage is retrieved.

System.Boolean onlyPublished

if set to true only published versions will be checked.

System.Boolean isDynamic

if set to true only dynamic properties will be considered.

Returns
Type Description
System.Collections.Generic.IEnumerable<ContentUsage>

List of ContentUsage which contains information on what content uses the specified PropertyDefinition.

List(Int32)

Lists all PropertyDefinitions in the data repository for a specific page type id.

Declaration
public abstract IEnumerable<PropertyDefinition> List(int pageTypeID)
Parameters
Type Name Description
System.Int32 pageTypeID

The page type id.

Returns
Type Description
System.Collections.Generic.IEnumerable<PropertyDefinition>

Enumeration of PropertyDefinitions on specified page type.

ListDynamic()

Lists all PropertyDefinitions in the data repository that are dynamic properties.

Declaration
public IEnumerable<PropertyDefinition> ListDynamic()
Returns
Type Description
System.Collections.Generic.IEnumerable<PropertyDefinition>

A list of PropertyDefinitions that are dynamic properties.

Load(Int32)

Loads a PropertyDefinition with the specified id from the data repository.

Declaration
public abstract PropertyDefinition Load(int propertyDefinitionID)
Parameters
Type Name Description
System.Int32 propertyDefinitionID

The Id of the definition to load.

Returns
Type Description
PropertyDefinition

The PropertyDefinition that matches the given id or null if noone could be found.

OnPropertyDefinitionDeleted(EventArgs)

Raises the PropertyDefinitionDeleted event.

Declaration
protected virtual void OnPropertyDefinitionDeleted(EventArgs args)
Parameters
Type Name Description
System.EventArgs args

The System.EventArgs instance containing the event data.

OnPropertyDefinitionSaved(EventArgs)

Raises the PropertyDefinitionSaved event.

Declaration
protected virtual void OnPropertyDefinitionSaved(EventArgs args)
Parameters
Type Name Description
System.EventArgs args

The System.EventArgs instance containing the event data.

Save(PropertyDefinition)

Saves the specified PropertyDefinition to the data repository.

Declaration
public void Save(PropertyDefinition propertyDefinition)
Parameters
Type Name Description
PropertyDefinition propertyDefinition

The property definition to save.

Save(PropertyDefinition, Boolean)

Saves the specified PropertyDefinition to the data repository.

Declaration
public abstract void Save(PropertyDefinition propertyDefinition, bool forceCacheClear)
Parameters
Type Name Description
PropertyDefinition propertyDefinition

The property definition to save.

System.Boolean forceCacheClear

Flag to determine if cache should be cleared regardless if anything is changed.

Events

PropertyDefinitionDeleted

Occurs when a PropertyDefinition has been deleted.

Declaration
public static event EventHandler<EventArgs> PropertyDefinitionDeleted
Event Type
Type Description
System.EventHandler<System.EventArgs>

PropertyDefinitionSaved

Occurs when a PropertyDefinition has been saved, i.e. created or updated.

Declaration
public static event EventHandler<EventArgs> PropertyDefinitionSaved
Event Type
Type Description
System.EventHandler<System.EventArgs>

Implements

Extension Methods