C# Class FiftyOne.Foundation.UI.Web.BaseUserControl

The base user control containing common methods shared across controls.
Inheritance: System.Web.UI.UserControl
Datei anzeigen Open project: 51Degrees/dotNET-Device-Detection

Protected Properties

Property Type Description
_container System.Web.UI.WebControls.Panel
_footer Stats
_removeBadCharacters Regex

Private Properties

Property Type Description
AddLink void
GetHardwareImages HardwareImage[]
WriteLinkStart void

Protected Methods

Method Description
AddBreak ( ) : void

Adds a
to the controls.

AddLabel ( WebControl panel, string text, string tooltip, Uri url, string anchor ) : void

Adds a label control to the panel provided, setting the label controls text to the value provided.

AddPlus ( WebControl control, string style ) : System.Web.UI.WebControls.Panel

Adds a plus toggle to the control, and then returns the control added.

AddTag ( string>.List list, string key, string value ) : void

Adds the tag and replacement value to the list.

BuildExternalLink ( XmlWriter writer, Uri url, string title ) : void

Adds a hyperlink prefix to the XML.

BuildHardwareImages ( XmlWriter writer, Profile profile ) : void

Adds thee HTML for the rotating images for the profile to the writer.

GetNewUrl ( NameValueCollection parameters, string key, string value ) : string

Returns a new url that will replace, or add a parameter to the one that is currently being used.

GetNewUrl ( string absoluteUrl, NameValueCollection parameters ) : string

Returns a new url that will replace, or add a parameter to the one that is currently being used.

GetNewUrl ( string absoluteUrl, NameValueCollection parameters, string key ) : string

Returns a new url that will replace, or add a parameter to the one that is currently being used.

GetNewUrl ( string absoluteUrl, NameValueCollection parameters, string key, string value ) : string

Returns a new url that will replace, or add a parameter to the one that was supplied.

GetNewUrl ( string key, string value ) : string

Creates a new GET url containing the key and value parameters.

OnInit ( EventArgs e ) : void

Adds the legend to the list of controls.

OnPreRender ( EventArgs e ) : void

Sets the CSS class of the control.

Page_PreRenderComplete ( object sender, EventArgs e ) : void

Displays the logo if requested and the footer.

ReplaceTags ( string source ) : string

Replaces all the standard tags in the source text with the values defined for the user control.

ReplaceTags ( string source, string>.List tags ) : string

Replaces the tag with the value in the text provided.

WriteDeviceProfile ( XmlWriter writer, Profile profile, string deviceUrl ) : void

Writes the hardware profile to the writer.

Private Methods

Method Description
AddLink ( WebControl panel, string tooltip, Uri url ) : void

Adds a link control to the output for the value provided.

GetHardwareImages ( Profile profile ) : HardwareImage[]

Returns the hardware images for the profile as an array.

WriteLinkStart ( XmlWriter writer, Profile profile, string deviceUrl, string text, string title = null ) : void

Method Details

AddBreak() protected method

Adds a
to the controls.
protected AddBreak ( ) : void
return void

AddLabel() protected method

Adds a label control to the panel provided, setting the label controls text to the value provided.
protected AddLabel ( WebControl panel, string text, string tooltip, Uri url, string anchor ) : void
panel System.Web.UI.WebControls.WebControl Control the label will be added to.
text string The text that will appear in the label.
tooltip string The tooltip that will be displayed next to the label.
url System.Uri A url for more information.
anchor string The name of the anchor.
return void

AddPlus() protected method

Adds a plus toggle to the control, and then returns the control added.
protected AddPlus ( WebControl control, string style ) : System.Web.UI.WebControls.Panel
control System.Web.UI.WebControls.WebControl The parent control.
style string The CSS display style to apply when expanding.
return System.Web.UI.WebControls.Panel

AddTag() protected static method

Adds the tag and replacement value to the list.
protected static AddTag ( string>.List list, string key, string value ) : void
list string>.List
key string
value string
return void

BuildExternalLink() protected method

Adds a hyperlink prefix to the XML.
protected BuildExternalLink ( XmlWriter writer, Uri url, string title ) : void
writer System.Xml.XmlWriter
url System.Uri A URL to the external link
title string The title attribute for the external link
return void

BuildHardwareImages() protected method

Adds thee HTML for the rotating images for the profile to the writer.
protected BuildHardwareImages ( XmlWriter writer, Profile profile ) : void
writer System.Xml.XmlWriter Write producing the output XML
profile Profile Profile who's images should be added
return void

GetNewUrl() protected method

Returns a new url that will replace, or add a parameter to the one that is currently being used.
protected GetNewUrl ( NameValueCollection parameters, string key, string value ) : string
parameters System.Collections.Specialized.NameValueCollection Existing list of parameters to be altered.
key string The parameter key.
value string The parameter value.
return string

GetNewUrl() protected method

Returns a new url that will replace, or add a parameter to the one that is currently being used.
protected GetNewUrl ( string absoluteUrl, NameValueCollection parameters ) : string
absoluteUrl string The root url to add parameters too.
parameters System.Collections.Specialized.NameValueCollection Existing list of parameters to be altered.
return string

GetNewUrl() protected method

Returns a new url that will replace, or add a parameter to the one that is currently being used.
protected GetNewUrl ( string absoluteUrl, NameValueCollection parameters, string key ) : string
absoluteUrl string The root url to add parameters too.
parameters System.Collections.Specialized.NameValueCollection Existing list of parameters to be altered.
key string A parameter key not to be removed from the list of parameters.
return string

GetNewUrl() protected method

Returns a new url that will replace, or add a parameter to the one that was supplied.
protected GetNewUrl ( string absoluteUrl, NameValueCollection parameters, string key, string value ) : string
absoluteUrl string The root url to add parameters too.
parameters System.Collections.Specialized.NameValueCollection Existing list of parameters to be altered.
key string The parameter key.
value string The parameter value.
return string

GetNewUrl() protected method

Creates a new GET url containing the key and value parameters.
protected GetNewUrl ( string key, string value ) : string
key string The parameter key.
value string The parameter value.
return string

OnInit() protected method

Adds the legend to the list of controls.
protected OnInit ( EventArgs e ) : void
e System.EventArgs
return void

OnPreRender() protected method

Sets the CSS class of the control.
protected OnPreRender ( EventArgs e ) : void
e System.EventArgs
return void

Page_PreRenderComplete() protected method

Displays the logo if requested and the footer.
protected Page_PreRenderComplete ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

ReplaceTags() protected method

Replaces all the standard tags in the source text with the values defined for the user control.
protected ReplaceTags ( string source ) : string
source string
return string

ReplaceTags() protected static method

Replaces the tag with the value in the text provided.
protected static ReplaceTags ( string source, string>.List tags ) : string
source string The source string builder.
tags string>.List Collection of tags and their new values.
return string

WriteDeviceProfile() protected method

Writes the hardware profile to the writer.
protected WriteDeviceProfile ( XmlWriter writer, Profile profile, string deviceUrl ) : void
writer System.Xml.XmlWriter
profile Profile
deviceUrl string
return void

Property Details

_container protected_oe property

The container for the all controls in the user control.
protected Panel,System.Web.UI.WebControls _container
return System.Web.UI.WebControls.Panel

_footer protected_oe property

Footer control used to display stats about the provider.
protected Stats,FiftyOne.Foundation.UI.Web _footer
return Stats

_removeBadCharacters protected_oe static_oe property

Used to remove white space and other characters that aren't valid ID attributes in HTML.
protected static Regex _removeBadCharacters
return Regex