C# Class Open.Core.Html

HTML constants and DOM manipulation.
Afficher le fichier Open project: philcockfield/Open.TestHarness.SL

Méthodes publiques

Méthode Description
Append ( jQueryObject parent, string tag ) : jQueryObject

Creates and appends a DIV element within the given parent.

AppendDiv ( jQueryObject parent ) : jQueryObject

Creates and appends a DIV element within the given parent.

ChildAt ( int index, jQueryObject parent ) : jQueryObject

Retrieves the child at the specified index, otherwise Null.

CreateDiv ( ) : jQueryObject

Creates a DIV element.

CreateElement ( string tag ) : jQueryObject

Creates a new element with the given tag.

CreateImage ( string src, string alt ) : jQueryObject

Creates an IMG element.

CreateSpan ( ) : jQueryObject

Creates a SPAN element.

GetOrCreateId ( jQueryObject element ) : string

Gets the elements ID, creating a unique ID of the element doesn't already have one.

Height ( string cssSelector ) : int

Retrieves the height of the specified element.

OuterHtml ( jQueryObject element ) : string

Retreives the OuterHtml of the given element.

ReplaceWith ( string replaceSeletor, jQueryObject withReplacement, bool copyCssClasses ) : void

Replaces an element with the given object.

SetDisabled ( jQueryObject input, bool isEnabled ) : void

Adds or removes the 'disabled' attribute on the given INPUT element.

SpanIndent ( int pixels ) : string

Creates a SPAN element with a magin-left set to the specified pixels (useful for indenting text).

ToBold ( string text ) : string

Wraps the given text in elements.

ToHyperlink ( string url, string text, LinkTarget target ) : string

Formats the URL as a hyperlink.

Width ( string cssSelector ) : int

Retrieves the width of the specified element.

Private Methods

Méthode Description
ToHyperlink ( string url ) : string

Method Details

Append() public static méthode

Creates and appends a DIV element within the given parent.
public static Append ( jQueryObject parent, string tag ) : jQueryObject
parent jQueryObject The parent element to insert into
tag string The tag name (NOT including angle brackets).
Résultat jQueryObject

AppendDiv() public static méthode

Creates and appends a DIV element within the given parent.
public static AppendDiv ( jQueryObject parent ) : jQueryObject
parent jQueryObject The parent element to insert into
Résultat jQueryObject

ChildAt() public static méthode

Retrieves the child at the specified index, otherwise Null.
public static ChildAt ( int index, jQueryObject parent ) : jQueryObject
index int The index of the child (0-based).
parent jQueryObject The parent to look within.
Résultat jQueryObject

CreateDiv() public static méthode

Creates a DIV element.
public static CreateDiv ( ) : jQueryObject
Résultat jQueryObject

CreateElement() public static méthode

Creates a new element with the given tag.
public static CreateElement ( string tag ) : jQueryObject
tag string The HTML tag.
Résultat jQueryObject

CreateImage() public static méthode

Creates an IMG element.
public static CreateImage ( string src, string alt ) : jQueryObject
src string The URL to the image.
alt string The alternative text for the image.
Résultat jQueryObject

CreateSpan() public static méthode

Creates a SPAN element.
public static CreateSpan ( ) : jQueryObject
Résultat jQueryObject

GetOrCreateId() public static méthode

Gets the elements ID, creating a unique ID of the element doesn't already have one.
public static GetOrCreateId ( jQueryObject element ) : string
element jQueryObject The element to get the ID for.
Résultat string

Height() public static méthode

Retrieves the height of the specified element.
public static Height ( string cssSelector ) : int
cssSelector string The CSS selector of the element to measure.
Résultat int

OuterHtml() public static méthode

Retreives the OuterHtml of the given element.
public static OuterHtml ( jQueryObject element ) : string
element jQueryObject The element to retrieve the HTML for.
Résultat string

ReplaceWith() public static méthode

Replaces an element with the given object.
public static ReplaceWith ( string replaceSeletor, jQueryObject withReplacement, bool copyCssClasses ) : void
replaceSeletor string The CSS selector the element(s) to replace.
withReplacement jQueryObject The element to insert.
copyCssClasses bool Flag indicating if CSS classes should be copied from the old element to the new one.
Résultat void

SetDisabled() public static méthode

Adds or removes the 'disabled' attribute on the given INPUT element.
public static SetDisabled ( jQueryObject input, bool isEnabled ) : void
input jQueryObject The input element to effect.
isEnabled bool The enabled value.
Résultat void

SpanIndent() public static méthode

Creates a SPAN element with a magin-left set to the specified pixels (useful for indenting text).
public static SpanIndent ( int pixels ) : string
pixels int The number of pixels to indent.
Résultat string

ToBold() public static méthode

Wraps the given text in elements.
public static ToBold ( string text ) : string
text string The text to wrap.
Résultat string

ToHyperlink() public static méthode

Formats the URL as a hyperlink.
public static ToHyperlink ( string url, string text, LinkTarget target ) : string
url string The url to link to.
text string The display text of the link (null to use the URL).
target LinkTarget The target attribute.
Résultat string

Width() public static méthode

Retrieves the width of the specified element.
public static Width ( string cssSelector ) : int
cssSelector string The CSS selector of the element to measure.
Résultat int