C# Class Utilities.Web.HTMLExtensions

Mostra file Open project: JaCraig/Craig-s-Utility-Library

Public Methods

Method Description
AbsoluteRoot ( this Context ) : Uri

Returns the absolute root

AddScriptFile ( this Page, FileInfo File ) : void

Adds a script file to the header of the current page

ContainsHTML ( this Input ) : bool

Decides if the string contains HTML

HTTPCompress ( this Context, bool RemovePrettyPrinting = false, MinificationType Type = MinificationType.HTML ) : void

Adds HTTP compression to the current context

IsEncodingAccepted ( this Context, string Encoding ) : bool

Checks the request headers to see if the specified encoding is accepted by the client.

RemoveURLIllegalCharacters ( this Input ) : string

Removes illegal characters (used in uri's, etc.)

SetEncoding ( this Context, string Encoding ) : void

Adds the specified encoding to the response headers.

StripHTML ( this HTML ) : string

Removes HTML elements from a string

URLDecode ( this Input ) : string

URL decodes a string

URLEncode ( this Input ) : string

URL encodes a string

Private Methods

Method Description
RelativeRoot ( this Context ) : string
RemoveDiacritics ( string Input ) : string

Removes special characters (Diacritics) from the string

RemoveExtraHyphen ( string Input ) : string

Removes extra hyphens from a string

Method Details

AbsoluteRoot() public static method

Returns the absolute root
public static AbsoluteRoot ( this Context ) : Uri
Context this
return System.Uri

AddScriptFile() public static method

Adds a script file to the header of the current page
public static AddScriptFile ( this Page, FileInfo File ) : void
Page this Page to add it to
File FileInfo Script file
return void

ContainsHTML() public static method

Decides if the string contains HTML
public static ContainsHTML ( this Input ) : bool
Input this Input string to check
return bool

HTTPCompress() public static method

Adds HTTP compression to the current context
public static HTTPCompress ( this Context, bool RemovePrettyPrinting = false, MinificationType Type = MinificationType.HTML ) : void
Context this Current context
RemovePrettyPrinting bool /// Sets the response filter to a special stream that removes pretty printing from content ///
Type MinificationType /// The minification type to use (defaults to HTML if RemovePrettyPrinting is set to true, /// but can also deal with CSS and Javascript) ///
return void

IsEncodingAccepted() public static method

Checks the request headers to see if the specified encoding is accepted by the client.
public static IsEncodingAccepted ( this Context, string Encoding ) : bool
Context this
Encoding string
return bool

RemoveURLIllegalCharacters() public static method

Removes illegal characters (used in uri's, etc.)
public static RemoveURLIllegalCharacters ( this Input ) : string
Input this string to be converted
return string

SetEncoding() public static method

Adds the specified encoding to the response headers.
public static SetEncoding ( this Context, string Encoding ) : void
Context this Context to set the encoding on
Encoding string Encoding to set
return void

StripHTML() public static method

Removes HTML elements from a string
public static StripHTML ( this HTML ) : string
HTML this HTML laiden string
return string

URLDecode() public static method

URL decodes a string
public static URLDecode ( this Input ) : string
Input this Input to decode
return string

URLEncode() public static method

URL encodes a string
public static URLEncode ( this Input ) : string
Input this Input to encode
return string