Class ContentFragment

String fragment that represents a content placed in an XHTML string.

Inheritance
System.Object
ContentFragment
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.Core.Html.StringParsing
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class ContentFragment : IStringFragment, IReferenceMap, IContentGroup, ISecurable, IRenderSettings

Constructors

ContentFragment(IContentLoader, TemplateControlLoader, ISecuredFragmentMarkupGenerator, DisplayOptions, IPublishedStateAssessor, IDictionary<String, Object>)

Initializes a new instance of the ContentFragment class.

Declaration
public ContentFragment(IContentLoader contentLoader, TemplateControlLoader templateControlLoader, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, DisplayOptions displayOptions, IPublishedStateAssessor publishedStateAssessor, IDictionary<string, object> attributes)
Parameters
Type Name Description
IContentLoader contentLoader

The content loader.

TemplateControlLoader templateControlLoader

The template control loader.

ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator

The secured fragment markup generator.

DisplayOptions displayOptions

The display options service.

IPublishedStateAssessor publishedStateAssessor

The _published state verifier.

System.Collections.Generic.IDictionary<System.String, System.Object> attributes

The attributes.

Fields

ClassId

Declaration
public static readonly Guid ClassId
Field Value
Type Description
System.Guid

ContentDisplayOptionAttributeName

Declaration
public static readonly string ContentDisplayOptionAttributeName
Field Value
Type Description
System.String

ContentGuidAttributeName

Declaration
public static readonly string ContentGuidAttributeName
Field Value
Type Description
System.String

ContentLinkAttributeName

Declaration
public static readonly string ContentLinkAttributeName
Field Value
Type Description
System.String

ContentNameAttributeName

Declaration
public static readonly string ContentNameAttributeName
Field Value
Type Description
System.String

Properties

Content

Gets the content.

Declaration
[Obsolete("Use GetContent() instead.", false)]
public virtual IContent Content { get; }
Property Value
Type Description
IContent

The content.

ContentData

Gets the current content data instance.

Declaration
[Obsolete("Use GetContent() instead.", false)]
public virtual IContentData ContentData { get; }
Property Value
Type Description
IContentData

ContentGroup

Gets the content group.

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

The content group.

ContentGuid

Gets or sets the unique identifier of the content referenced by the fragment.

Declaration
public virtual Guid ContentGuid { get; set; }
Property Value
Type Description
System.Guid

Gets or sets the content link.

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

The content link.

DisplayOption

Gets the Display options selected for this fragment

Declaration
public DisplayOption DisplayOption { get; }
Property Value
Type Description
DisplayOption

InternalFormat

Gets the internal format of the fragment, that is what is stored in db

Declaration
public virtual string InternalFormat { get; }
Property Value
Type Description
System.String

The internal format.

ReferencedPermanentLinkIds

Gets an System.Collections.Generic.IList<T> of permanent link ids that are referenced from this property.

Declaration
public IList<Guid> ReferencedPermanentLinkIds { get; }
Property Value
Type Description
System.Collections.Generic.IList<System.Guid>

An System.Collections.Generic.IList<T> of permanent link ids that are referenced from this property.

RenderSettings

Gets or sets the custom render settings for the fragment

Declaration
public IDictionary<string, object> RenderSettings { get; set; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.String, System.Object>

Tag

Gets or sets the tag for the Content Fragment.

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

Methods

GetContent()

Gets the current content host instance.

Declaration
public virtual IContent GetContent()
Returns
Type Description
IContent

GetContent(Boolean)

Retrieves the current content instance with the ability to determine if master language fallback should be used.

Declaration
public virtual IContent GetContent(bool enableMasterLanguageFallback)
Parameters
Type Name Description
System.Boolean enableMasterLanguageFallback

Whether to use fallback for languageselector or not

Returns
Type Description
IContent

GetControl(TemplateControl)

Gets the control that can be placed in Page Control collection

Declaration
public Control GetControl(TemplateControl hostPage)
Parameters
Type Name Description
System.Web.UI.TemplateControl hostPage
Returns
Type Description
System.Web.UI.Control

GetEditFormat()

Gets the format for edit mode

Declaration
public string GetEditFormat()
Returns
Type Description
System.String

GetSecurityDescriptor()

Gets the security descriptor.

Declaration
public ISecurityDescriptor GetSecurityDescriptor()
Returns
Type Description
ISecurityDescriptor

An implementation of ISecurityDescriptor.

GetViewFormat()

Gets the format for view mode

Declaration
public string GetViewFormat()
Returns
Type Description
System.String

RemapPermanentLinkReferences(IDictionary<Guid, Guid>)

Remaps permanent links according to the provided link mapping.

Declaration
public void RemapPermanentLinkReferences(IDictionary<Guid, Guid> idMap)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.Guid, System.Guid> idMap

The link mapping.

Implements

Extension Methods