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

Class HtmlFragment

Abstract base class for all HTML fragment types.

Inherited Members
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.HtmlParsing
Assembly: EPiServer.Framework.dll
Version: 10.10.4
Syntax
public abstract class HtmlFragment

Constructors

HtmlFragment(HtmlFragmentType)

Initializes a new instance of the HtmlFragment class.

Declaration
protected HtmlFragment(HtmlFragmentType fragmentType)
Parameters
Type Name Description
HtmlFragmentType fragmentType

Type of the fragment.

Fields

EndOfStreamChar

Declaration
protected const char EndOfStreamChar = '\uffff'
Field Value
Type Description
System.Char

Properties

FragmentType

Gets or sets the type of the fragment.

Declaration
public HtmlFragmentType FragmentType { get; }
Property Value
Type Description
HtmlFragmentType

The type of the fragment.

IsEmpty

Gets or sets a value indicating whether this instance is empty.

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

true if this instance is empty; otherwise, false.

Remarks

The exact meaning of "Empty" varies slightly between different fragment types. See the class description for details.

Name

Gets or sets the name of the fragment.

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

The name.

Value

Gets or sets the value of the fragment.

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

The value.

Methods

NameEquals(String)

Case-insensitive comparison of the attribute name.

Declaration
public bool NameEquals(string name)
Parameters
Type Name Description
System.String name

The name.

Returns
Type Description
System.Boolean

True if the given parameter is equal to th eattribute name, False otherwise.

Parse(IHtmlParserContext)

Parses the fragment from the specified context.

Declaration
public abstract void Parse(IHtmlParserContext context)
Parameters
Type Name Description
IHtmlParserContext context

The context.

ToString()

Returns a System.String that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents this instance.

Overrides
System.Object.ToString()

ToWriter(TextWriter)

Writes the fragment to the given TextWriter.

Declaration
public abstract void ToWriter(TextWriter writer)
Parameters
Type Name Description
System.IO.TextWriter writer

The writer.

Extension Methods