Class XFormsFragment
Base class for all XForms fragments
Inheritance
Inherited Members
Namespace: EPiServer.XForms.Parsing
Assembly: EPiServer.XForms.dll
Version: 9.12.2Syntax
public abstract class XFormsFragment : HtmlFragment
Constructors
XFormsFragment()
Declaration
public XFormsFragment()
XFormsFragment(ElementFragment)
Declaration
public XFormsFragment(ElementFragment fragment)
Parameters
Type | Name | Description |
---|---|---|
ElementFragment | fragment |
Properties
Attributes
A collection of all attributes defined on this fragment
Declaration
public AttributeCollection Attributes { get; set; }
Property Value
Type | Description |
---|---|
AttributeCollection |
Class
CSS class
Declaration
public string Class { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Reference
Which data item is being referenced
Declaration
public string Reference { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Required
if value is required for the fragment
Declaration
public bool Required { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Title
The title used for help texts
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ValidationReference
To be sure we have a unique validation reference Normally it should be reference or name of field but to avoiding to have conflict with other xform a unique field is used
Declaration
public string ValidationReference { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ValidationType
Declaration
public string ValidationType { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Parse(IHtmlParserContext)
Not used by XForms
Declaration
public override void Parse(IHtmlParserContext context)
Parameters
Type | Name | Description |
---|---|---|
IHtmlParserContext | context |
Overrides
ParseFragment(Stack<HtmlFragment>, HtmlFragment)
Parse the current child fragment to build up the properties.
Declaration
public abstract void ParseFragment(Stack<HtmlFragment> stack, HtmlFragment currentFragment)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Stack<HtmlFragment> | stack | The hierarchy from the root xforms element down the current fragment |
HtmlFragment | currentFragment | The currently processed fragment |
ReadAttribute(String)
Helper method to read an attribute
Declaration
public string ReadAttribute(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the attribute |
Returns
Type | Description |
---|---|
System.String | The value of the attribute or an empty string if not found |
ReadAttribute<T>(String)
Declaration
[CLSCompliant(false)]
public T ReadAttribute<T>(string name)
where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
RegexValidationFailed(NameValueCollection)
Validates this xforms fragment according to it's ValidationType.
Declaration
public bool RegexValidationFailed(NameValueCollection formValues)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NameValueCollection | formValues | The posted form values. |
Returns
Type | Description |
---|---|
System.Boolean | True if the formValues are invalid. |
RequiredValidationFailed(NameValueCollection)
Validates a posted form collection against this xforms fragment
Declaration
public virtual bool RequiredValidationFailed(NameValueCollection formValues)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NameValueCollection | formValues | The posted form values. |
Returns
Type | Description |
---|---|
System.Boolean | True if the formValues are invalid. |
ToWriter(TextWriter)
Default rendering which is not handled by the parser but rather the presentation layer
Declaration
public override void ToWriter(TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextWriter | writer |