Class
iAttribute

This class represents a markup attribute (foo="bar"). The iAttribute object contains a starting 'i' to distinguish it from System.Attribute.

Definition

Namespace:ArtOfTest.WebAii.ObjectModel

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class iAttribute : INotifyPropertyChanged, IiAttribute

Inheritance: objectiAttribute

Implements: INotifyPropertyChangedIiAttribute

Constructors

iAttribute()

Create a new attribute.

Declaration

cs-api-definition
public iAttribute()

iAttribute(string, string)

Create a new attribute.

Declaration

cs-api-definition
public iAttribute(string name, string value)

Parameters

name

string

Name of the attribute.

value

string

Value of the attribute.

Properties

AttributeType

Gets the attribute type (i.e. Style/Event/Other).

Declaration

cs-api-definition
public AttributeType AttributeType { get; }

Property Value

AttributeType

BeginQuote

Gets/Sets the begin quote type of the attribute.

Declaration

cs-api-definition
[Browsable(false)]
public Quote BeginQuote { get; set; }

Property Value

Quote

DecodedValue

The value of the attribute after converting any HTML entities to normal characters e.g. & -> &

Declaration

cs-api-definition
public string DecodedValue { get; }

Property Value

string

EndQuote

Gets/Sets the end quote type of the attribute

Declaration

cs-api-definition
[Browsable(false)]
public Quote EndQuote { get; set; }

Property Value

Quote

IsSingular

Gets/Sets whether the attribute is singluar.

csharp
The nowrap attribute is a singluar attribute in  <foo id="myfoo" nowrap /> .

Declaration

cs-api-definition
[Browsable(false)]
public bool IsSingular { get; set; }

Property Value

bool

Name

Gets/Sets the name of this attribute.

Declaration

cs-api-definition
public string Name { get; set; }

Property Value

string

Implements IiAttribute.Name

RawValue

The raw value of the attribute including any quotes.

Declaration

cs-api-definition
public string RawValue { get; }

Property Value

string

Styles

The Styles collection if AttributeType = Style.

The following element <foo style="height:1px;width:2px;" /> , will contain a NameValueCollection that consists of two items:

The first : name=height,value=1px The second : name=width,value=2px

Declaration

cs-api-definition
[Browsable(false)]
public NameValueCollection Styles { get; }

Property Value

NameValueCollection

Value

Gets/Sets the value of this attribute. The value will be trimmed from any beginning or ending quotes. If you need the raw value use the RawValue property.

Declaration

cs-api-definition
public string Value { get; set; }

Property Value

string

Implements IiAttribute.Value

Methods

ContainsPartialAttributeValue(iAttribute, StringComparison)

Determines whether a partial attribute value is contained in this attribute value Also makes sure the attribute name is correct.

Declaration

cs-api-definition
public bool ContainsPartialAttributeValue(iAttribute partialAttributeToCompare, StringComparison comparison)

Parameters

partialAttributeToCompare

iAttribute

The partial attribute to compare.

comparison

StringComparison

Type of comparison to perform.

Returns

bool

True/False whether this attribute contains the parital attribute value passed in.

Equals(iAttribute, StringComparison, bool)

Determines equality between two attributes

Declaration

cs-api-definition
public bool Equals(iAttribute obj, StringComparison comparison, bool matchQuotes)

Parameters

obj

iAttribute

The object to compare.

comparison

StringComparison

The type of comparsion to perform.

matchQuotes

bool

Whether to match the begin/end quotes or just the value.

Returns

bool

True/False whether they are the same.

GetAttributeList(params string[])

Quick shortcut to get a list of attributes. Pass in the name/value pairs as a semi-colon delimited list.

For example: GetAttributeList("id=foo","checked=true")

Note: Any string that don't contain a pair will be ignored. Don't include an type of quotes.

Declaration

cs-api-definition
public static Collection<iAttribute> GetAttributeList(params string[] nameValuePairs)

Parameters

nameValuePairs

string[]

The name value pairs.

Returns

Collection<iAttribute>

The list of attributes.

ToString()

A string representation of the attribute.

Declaration

cs-api-definition
public override string ToString()

Returns

string

The string representation.

Overrides object.ToString()

Events

PropertyChanged

Occurs when a property changes on this iAttribute object.

Declaration

cs-api-definition
public event PropertyChangedEventHandler PropertyChanged

Event Value

PropertyChangedEventHandler

Implements INotifyPropertyChanged.PropertyChanged