Files
mono/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
T
Dean Brettle 23000b3144 ++ Test/mainsoft/ChangeLog (working copy)
* add new resources: 
		PageWithAdapter.aspx for PageTest and PageAdapterTest.
		TestCapability.browser for AppBrowsersTest.

	* NunitWebResources/adapters.browser, 
	NunitWebResources/AppBrowsersTest.browser: modified to support
	testing reference nodes with captures, and adapters.

	* NunitWeb/NunitWeb/WebTest.cs: ensure that, during AppDomain
	unload, no new requests are sent to the app host and any
	pending requests are completed before the the unload occurs.
	Also added WebTest.AppUnloaded event that tests can use to wait
	for the app to unload (e.g. after touching Global.asax), and 
	WebTest.CleanApp() which can be called to restart the app with
	the a skeleton directory structure.  Tests which add files that
	could effect other tests (e.g. App_Browsers/*.browser files) should
	call WebTest.CleanApp() during TearDown to return the app to a 
	pristine environment.
	
++ Test/mainsoft/MainsoftWebTest/ChangeLog	(working copy)

	* HtmlAgilityPack/AssemblyInfo.cs: made assembly delay signed so that 
	tests can access System.Web internals now that System.Web is
	InternalsVisibleTo this assembly.

++ Test/System.Web/ChangeLog	(working copy)

	* AppBrowsersTest.cs: added.  Includes tests for Control.Adapter,
	Control.ResolveAdapter,	Control.TagWriter, and
	Control.CreateHtmlTextWriter, when using App_Browsers/*.browser files.
	AppBrowsersTest is currently tagged [Ignore], pending a fix for 
	bug #351878.
	
	* HttpRuntimeTest.cs: added. Includes test for 
	HttpRuntime.UnloadAppDomain().  Marked [Ignore], pending a fix for
	bug #351878.
	
++ Test/System.Web.UI.Adapters/ChangeLog	(revision 0)

	* PageAdapterTest.cs: added tests for PageAdapter.


	* ControlAdapterTest.cs (ConfigCapabilitiesNotCalled): added test to
	ensure that HttpCapabilitiesBase.ConfigCapabilities() is not called
	during normal page processing if no files are in App_Browsers.
	


	* ControlAdapterTest.cs: added tests for ControlAdapter.
++ Test/System.Web.UI/ChangeLog	(working copy)

	* PageTest.cs: add tests for using a PageAdapter.
	
	* ControlTest.cs: moved commented out ResolveAdapter_1 test to 
	../System.Web/AppBrowsersTest.cs.  Fixed typo in test name.  
	Added Customcontroladapter.Adapter property for use by AppBrowsersTest.

++ Test/System.Web.UI.WebControls.Adapters/ChangeLog	(revision 0)

	* MenuAdapterTest.cs: added


	* WebControlAdapterTest.cs, HierarchicalDataBoundControlAdapterTest.cs,
	DataBoundControlAdapterTest.cs, HideDisabledControlAdapterTest.cs: added
++ Test/System.Web.UI.WebControls/ChangeLog	(working copy)

	* MenuTest.cs (Menu_RenderStaticItems): added tests to check that
	result was the same when using the base MenuAdapter as when using
	no adapter.
	
	* MenuTest.cs (Menu_RenderStaticItemsWithAdapter): added test
	to ensure that MenuAdapter.RenderItem() is called.

	* HierarchicalDataBoundControlTest.cs, WebControlTest.cs, 
	DataBoundControlTest.cs: added test for use of ControlAdapters
	when present.
	
	* WebControl.cs: added test for IsEnabled.

++ System.Web/ChangeLog	(working copy)

	* HttpApplicationFactory.cs: Added support for detecting 
	App_Browsers/*.browser files and using them to determine capabilities.
	Also restart the app if the App_Browsers, App_Code, or App_GlobalResources
	directories are created.

	* BrowserCapabilities.cs (TagWriter): get value via internal virtual
	GetTagWriter() method, which is overridden in nBrowser.Result.

	* HttpRequest.cs (BrowserMightHaveSpecialWriter, BrowserMightHaveAdapters):
	internal properties added to allow Page and Control methods to avoid
	accessing Request.Browser to get browser-specific HtmlTextWriters or 
	ControlAdapters.  Those things only exist when there are App_Browsers
	files.

++ System.Web.UI.Adapters/ChangeLog	(working copy)

	* ControlAdapter.cs: made control field internal so
	derived internal classes can access it without using base.Control
	which can involved several typecasts.


	* PageAdapter.cs: implemented all members.
	

	* ControlAdapter.cs: implemented all members.
	
	* PageAdapter.cs, ControlAdapter.cs: add MonoTODO's.
++ System.Web.UI/ChangeLog	(working copy)

	* Page.cs (SavePageControlState, LoadPageControlState): save/load 
	adapter state in 2.0 profile.
	
	* Page.cs (CreateHtmlTextWriter): call Browser.CreateHtmlTextWriter()
	in 2.0 profile.
	
	* Page.cs (RenderPage): call CreateHtmlTextWriter() to get the writer
	in 2.0 profile.
	
	* Page.cs (DeterminePostBackMode, InitOutputCache, 
	RenderClientScriptFormDeclaration,	InternalProcessRequest,
	PageStatePersister): added support for PageAdapters.

	* Control.cs (Adapter, ResolveAdapter): implemented.  Adapter calls
	ResolveAdapter and remembers result.  ResolveAdapter checks for adapters
	of the Type hierarchy until it finds one.
	
	* Control.cs (SaveViewStateRecursive, LoadViewStateRecursive): save/load
	adapter state in 2.0 profile.
	
	* HtmlTextWriter.cs (BeginRender, EndRender): added empty virtual methods
	required by 2.0 profile.  These are called by corresponding methods of
	System.Web.UI.Adapters.ControlAdapter.
	
	* Page.cs, Control.cs: don't access Request.Browser if it couldn't have
	any adapters/writers because there are no files in App_Browsers/.

++ Assembly/ChangeLog	(working copy)

	* AssemblyInfo.cs: made InternalsVisibleTo System.Web.test_net_2_0.dll
	to support ControlAdapterTest.ConfigCapabilitiesNotCalled().

++ ChangeLog	(working copy)

	* System.Web_test.dll.sources: added
		System.Web.UI.WebControls.Adapters/MenuAdapterTest.cs
		System.Web.UI.WebControls.Adapters/WebControlAdapterTest.cs
		System.Web.UI.WebControls.Adapters/HierarchicalDataBoundControlAdapterTest.cs
		System.Web.UI.WebControls.Adapters/DataBoundControlAdapterTest.cs
		System.Web.UI.WebControls.Adapters/HideDisabledControlAdapterTest.cs
		System.Web.UI.Adapters/PageAdapterTest.cs
		System.Web.UI.Adapters/ControlAdapterTest.cs
		
	* Makefile (RESOURCE_FILES_2): added
		System.Web.Configuration_2.0/RandomRoboBotKeywords.txt

	* Makefile (TEST_RESOURCE_FILES): added 
		Test/mainsoft/NunitWebResources/PageWithAdapter.aspx

	* System.Web.dll.sources: added
		System.Web.Configuration_2.0/CapabilitiesBuild.cs
		System.Web.Configuration_2.0/CapabilitiesChecksum.cs
		System.Web.Configuration_2.0/CapabilitiesResult.cs
		System.Web.Configuration_2.0/ICapabilitiesProcess.cs
		System.Web.Configuration_2.0/nBrowser/Result.cs
		System.Web.Configuration_2.0/nBrowser/NodeTypes.cs
		System.Web.Configuration_2.0/nBrowser/Identification.cs
		System.Web.Configuration_2.0/nBrowser/File.cs
		System.Web.Configuration_2.0/nBrowser/Build.cs
		System.Web.Configuration_2.0/nBrowser/Node.cs
		System.Web.Configuration_2.0/nBrowser/Exception.cs
		
++ System.Web.UI.WebControls.Adapters/ChangeLog	(working copy)

	* WebControlAdapter.cs, HierarchicalDataBoundControlAdapter.cs,
	DataBoundControlAdapter.cs: changed to use ControlAdapter.control
	instead of using base.Control or using a new control field.
	
	* MenuAdapter.cs: added	internal constructor that takes a Menu
	parameter.  The constructor is used when writing unit tests.
	
	* MenuAdapter.cs (OnInit, OnPreRender, RenderBeginTag, 
	RenderContents, RenderEndTag): delegate to base instead of
	Control.
	
	* MenuAdapter.cs (LoadAdapterControlState, SaveAdapterControlState,
	RaisePostBackEvent, RenderItem): implemented.
	

	* WebControlAdapter.cs (RenderContents): changed to call 
	control.RenderContents() instead of control.Render().
	
	* WebControlAdapter.cs, HierarchicalDataBoundControlAdapter.cs,
	DataBoundControlAdapter.cs, HideDisabledControlAdapter.cs: added
	internal constructor that takes a parameter of the corresponding
	Control type.  The construct is used when writing unit tests.

++ System.Web.Configuration_2.0/ChangeLog	(working copy)

	* nBrowser/Result.cs, nBrowser/NodeTypes.cs, nBrowser/Identification.cs,
	nBrowser/File.cs, nBrowser/Build.cs, nBrowser/Node.cs, 
	nBrowser/Exception.cs: added.  The code under nBrowser handles *.browser
	files.  It is based on Owen "Ocean" Brady's code, with the following 
	changes and improvements.  Replaced Result.Adapter 
	property with AdapterTypeMap property which maps control Type to adapter
	Type.  Added Result.MarkupTextWriter property.  Added overrides for
	Result.GetAdapters and Result.GetTagWriter to return MarkupTextWriter
	and AdapterTypeMap, resp.  Changed tree building algorithm to not
	depend on nodes with id="Default" and to inject defaultBrowser nodes
	as parents of regular nodes with the same ids.  Changed Node.cs to use
	Item instead of Add when adding a capability or sample header, so that
	values get replaced instead of appended.  Added support for reference 
	nodes (ie. nodes with refID="someID").
		
	* CapabilitiesResult.cs: load RandomRoboBotKeywords.txt resource
	using the correct name.
	
	* RandomRoboBotKeywords.txt: added 

	* HttpCapabilitiesBase.cs (CreateHtmlWriter, Adapters): Added
	support for *.browsers.  Adapters property calls internal virtual
	GetAdapters() method which is overrided in nBrowser.Result 
	returned by nBrowser code.  CreateHtmlWriter uses type specified
	by TagWriter property.
	
++ System.Web.UI.WebControls/ChangeLog	(working copy)

	* DetailsView.cs, ListControl.cs, DataBoundControl.cs, 
	FormView.cs, HierarchicalDataBoundControl.cs, WebControl.cs: 
	added support for using ControlAdapters when present.
	
	* WebControl.cs: fixed implementation of IsEnabled to match 
	documentation.

	* Menu.cs (RenderMenuBody): call Adapter.RenderItem() instead of 
	RenderMenuItem() if an adapter is present.  MenuAdapter.RenderItem() 
	calls back to new Menu.RenderItem() internal method which calls
	RenderMenuItem() with the appropriate parameters.

++ System.Web.Configuration/ChangeLog	(working copy)

	* HttpCapabilitiesBase.cs: changed to use nBrowser for *.browser 
	support.  Also added internal GetConfigCapabilities_called
	flag used by ControlAdapterTest.ConfigCapabilitiesNotCalled() to 
	test that GetConfigCapabilities() is not called during normal page
	processing when there are no files in App_Browsers/.


svn path=/trunk/mcs/; revision=97824
2008-03-09 22:55:22 +00:00

1238 lines
37 KiB
C#

//
// System.Web.UI.HtmlTextWriter
//
// Author:
// Ben Maurer <[email protected]>
//
// (c) 2005 Novell
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.IO;
using System.Globalization;
using System.Collections;
using System.Security.Permissions;
using System.Text;
using System.Web.UI.WebControls;
namespace System.Web.UI {
// CAS
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HtmlTextWriter : TextWriter {
readonly static Hashtable _tagTable;
readonly static Hashtable _attributeTable;
readonly static Hashtable _styleTable;
static HtmlTextWriter ()
{
#if NET_2_0
_tagTable = new Hashtable (tags.Length, StringComparer.OrdinalIgnoreCase);
_attributeTable = new Hashtable (htmlattrs.Length, StringComparer.OrdinalIgnoreCase);
_styleTable = new Hashtable (htmlstyles.Length, StringComparer.OrdinalIgnoreCase);
#else
_tagTable = new Hashtable (tags.Length,
CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
_attributeTable = new Hashtable (htmlattrs.Length,
CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
_styleTable = new Hashtable (htmlstyles.Length,
CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
#endif
foreach (HtmlTag tag in tags)
_tagTable.Add (tag.name, tag);
foreach (HtmlAttribute attr in htmlattrs)
_attributeTable.Add (attr.name, attr);
foreach (HtmlStyle style in htmlstyles)
_styleTable.Add (style.name, style);
}
public HtmlTextWriter (TextWriter writer) : this (writer, DefaultTabString)
{
}
public HtmlTextWriter (TextWriter writer, string tabString)
{
b = writer;
tab_string = tabString;
}
internal static string StaticGetStyleName (System.Web.UI.HtmlTextWriterStyle styleKey)
{
if ((int) styleKey < htmlstyles.Length)
return htmlstyles [(int) styleKey].name;
return null;
}
[MonoTODO ("Does nothing")]
protected static void RegisterAttribute (string name, HtmlTextWriterAttribute key)
{
}
[MonoTODO ("Does nothing")]
protected static void RegisterStyle (string name, HtmlTextWriterStyle key)
{
}
[MonoTODO ("Does nothing")]
protected static void RegisterTag (string name, HtmlTextWriterTag key)
{
}
public virtual void AddAttribute (HtmlTextWriterAttribute key, string value, bool fEncode)
{
if (fEncode)
value = HttpUtility.HtmlAttributeEncode (value);
AddAttribute (GetAttributeName (key), value, key);
}
public virtual void AddAttribute (HtmlTextWriterAttribute key, string value)
{
if ((key != HtmlTextWriterAttribute.Name) && (key != HtmlTextWriterAttribute.Id))
value = HttpUtility.HtmlAttributeEncode (value);
AddAttribute (GetAttributeName (key), value, key);
}
public virtual void AddAttribute (string name, string value, bool fEncode)
{
if (fEncode)
value = HttpUtility.HtmlAttributeEncode (value);
AddAttribute (name, value, GetAttributeKey (name));
}
public virtual void AddAttribute (string name, string value)
{
HtmlTextWriterAttribute key = GetAttributeKey (name);
if ((key != HtmlTextWriterAttribute.Name) && (key != HtmlTextWriterAttribute.Id))
value = HttpUtility.HtmlAttributeEncode (value);
AddAttribute (name, value, key);
}
protected virtual void AddAttribute (string name, string value, HtmlTextWriterAttribute key)
{
NextAttrStack ();
#if TARGET_JVM
if (attrs [attrs_pos] == null)
attrs [attrs_pos] = new AddedAttr ();
#endif
attrs [attrs_pos].name = name;
attrs [attrs_pos].value = value;
attrs [attrs_pos].key = key;
}
protected virtual void AddStyleAttribute (string name, string value, HtmlTextWriterStyle key)
{
NextStyleStack ();
#if TARGET_JVM
if (styles [styles_pos] == null)
styles [styles_pos] = new AddedStyle ();
#endif
styles [styles_pos].name = name;
#if NET_2_0
value = HttpUtility.HtmlAttributeEncode (value);
#endif
styles [styles_pos].value = value;
styles [styles_pos].key = key;
}
public virtual void AddStyleAttribute (string name, string value)
{
AddStyleAttribute (name, value, GetStyleKey (name));
}
public virtual void AddStyleAttribute (HtmlTextWriterStyle key, string value)
{
AddStyleAttribute (GetStyleName (key), value, key);
}
public override void Close ()
{
b.Close ();
}
protected virtual string EncodeAttributeValue (HtmlTextWriterAttribute attrKey, string value)
{
return HttpUtility.HtmlAttributeEncode (value);
}
protected string EncodeAttributeValue (string value, bool fEncode)
{
if (fEncode)
return HttpUtility.HtmlAttributeEncode (value);
return value;
}
protected string EncodeUrl (string url)
{
return HttpUtility.UrlPathEncode (url);
}
protected virtual void FilterAttributes ()
{
AddedAttr style_attr = new AddedAttr ();
for (int i = 0; i <= attrs_pos; i++) {
AddedAttr a = attrs [i];
if (OnAttributeRender (a.name, a.value, a.key)) {
if (a.key == HtmlTextWriterAttribute.Style) {
style_attr = a;
continue;
}
WriteAttribute (a.name, a.value, false);
}
}
if (styles_pos != -1 || style_attr.value != null) {
Write (SpaceChar);
Write ("style");
Write (EqualsDoubleQuoteString);
for (int i = 0; i <= styles_pos; i++) {
AddedStyle a = styles [i];
if (OnStyleAttributeRender (a.name, a.value, a.key)) {
#if NET_2_0
if (a.key == HtmlTextWriterStyle.BackgroundImage) {
a.value = String.Concat ("url(", HttpUtility.UrlPathEncode (a.value), ")");
}
#endif
WriteStyleAttribute (a.name, a.value, false);
}
}
Write (style_attr.value);
Write (DoubleQuoteChar);
}
styles_pos = attrs_pos = -1;
}
public override void Flush ()
{
b.Flush ();
}
protected HtmlTextWriterAttribute GetAttributeKey (string attrName)
{
object attribute = _attributeTable [attrName];
if (attribute == null)
return (HtmlTextWriterAttribute) (-1);
return (HtmlTextWriterAttribute) ((HtmlAttribute) attribute).key;
}
protected string GetAttributeName (HtmlTextWriterAttribute attrKey)
{
if ((int) attrKey < htmlattrs.Length)
return htmlattrs [(int) attrKey].name;
return null;
}
protected HtmlTextWriterStyle GetStyleKey (string styleName)
{
object style = _styleTable [styleName];
if (style == null)
return (HtmlTextWriterStyle) (-1);
return (HtmlTextWriterStyle) ((HtmlStyle) style).key;
}
protected string GetStyleName (HtmlTextWriterStyle styleKey)
{
return StaticGetStyleName (styleKey);
}
protected virtual HtmlTextWriterTag GetTagKey (string tagName)
{
object tag = _tagTable [tagName];
if (tag == null)
return HtmlTextWriterTag.Unknown;
return (HtmlTextWriterTag) ((HtmlTag) tag).key;
}
internal static string StaticGetTagName (HtmlTextWriterTag tagKey)
{
if ((int) tagKey < tags.Length)
return tags [(int) tagKey].name;
return null;
}
protected virtual string GetTagName (HtmlTextWriterTag tagKey)
{
if ((int) tagKey < tags.Length)
return tags [(int) tagKey].name;
return null;
}
protected bool IsAttributeDefined (HtmlTextWriterAttribute key)
{
string value;
return IsAttributeDefined (key, out value);
}
protected bool IsAttributeDefined (HtmlTextWriterAttribute key, out string value)
{
for (int i = 0; i <= attrs_pos; i++)
if (attrs [i].key == key) {
value = attrs [i].value;
return true;
}
value = null;
return false;
}
protected bool IsStyleAttributeDefined (HtmlTextWriterStyle key)
{
string value;
return IsStyleAttributeDefined (key, out value);
}
protected bool IsStyleAttributeDefined (HtmlTextWriterStyle key, out string value)
{
for (int i = 0; i <= styles_pos; i++)
if (styles [i].key == key) {
value = styles [i].value;
return true;
}
value = null;
return false;
}
protected virtual bool OnAttributeRender (string name, string value, HtmlTextWriterAttribute key)
{
return true;
}
protected virtual bool OnStyleAttributeRender (string name, string value, HtmlTextWriterStyle key)
{
return true;
}
protected virtual bool OnTagRender (string name, HtmlTextWriterTag key)
{
return true;
}
protected virtual void OutputTabs ()
{
if (!newline)
return;
newline = false;
for (int i = 0; i < Indent; i++)
b.Write (tab_string);
}
protected string PopEndTag ()
{
if (tagstack_pos == -1)
throw new InvalidOperationException ();
string s = TagName;
tagstack_pos--;
return s;
}
protected void PushEndTag (string endTag)
{
NextTagStack ();
TagName = endTag;
}
void PushEndTag (HtmlTextWriterTag t)
{
NextTagStack ();
TagKey = t;
}
protected virtual string RenderAfterContent ()
{
return null;
}
protected virtual string RenderAfterTag ()
{
return null;
}
protected virtual string RenderBeforeContent ()
{
return null;
}
protected virtual string RenderBeforeTag ()
{
return null;
}
public virtual void RenderBeginTag (string tagName)
{
if (!OnTagRender (tagName, GetTagKey (tagName)))
return;
PushEndTag (tagName);
DoBeginTag ();
}
public virtual void RenderBeginTag (HtmlTextWriterTag tagKey)
{
if (!OnTagRender (GetTagName (tagKey), tagKey))
return;
PushEndTag (tagKey);
DoBeginTag ();
}
void WriteIfNotNull (string s)
{
if (s != null)
Write (s);
}
void DoBeginTag ()
{
WriteIfNotNull (RenderBeforeTag ());
WriteBeginTag (TagName);
FilterAttributes ();
HtmlTextWriterTag key = (int) TagKey < tags.Length ? TagKey : HtmlTextWriterTag.Unknown;
switch (tags [(int) key].tag_type) {
case TagType.Inline:
Write (TagRightChar);
break;
case TagType.Block:
Write (TagRightChar);
WriteLine ();
Indent++;
break;
case TagType.SelfClosing:
Write (SelfClosingTagEnd);
break;
}
// FIXME what do i do for self close here?
WriteIfNotNull (RenderBeforeContent ());
}
public virtual void RenderEndTag ()
{
// FIXME what do i do for self close here?
WriteIfNotNull (RenderAfterContent ());
HtmlTextWriterTag key = (int) TagKey < tags.Length ? TagKey : HtmlTextWriterTag.Unknown;
switch (tags [(int) key].tag_type) {
case TagType.Inline:
WriteEndTag (TagName);
break;
case TagType.Block:
Indent--;
WriteLineNoTabs ("");
WriteEndTag (TagName);
break;
case TagType.SelfClosing:
// NADA
break;
}
WriteIfNotNull (RenderAfterTag ());
PopEndTag ();
}
public virtual void WriteAttribute (string name, string value, bool fEncode)
{
Write (SpaceChar);
Write (name);
if (value != null) {
Write (EqualsDoubleQuoteString);
value = EncodeAttributeValue (value, fEncode);
Write (value);
Write (DoubleQuoteChar);
}
}
public virtual void WriteBeginTag (string tagName)
{
Write (TagLeftChar);
Write (tagName);
}
public virtual void WriteEndTag (string tagName)
{
Write (EndTagLeftChars);
Write (tagName);
Write (TagRightChar);
}
public virtual void WriteFullBeginTag (string tagName)
{
Write (TagLeftChar);
Write (tagName);
Write (TagRightChar);
}
public virtual void WriteStyleAttribute (string name, string value)
{
WriteStyleAttribute (name, value, false);
}
public virtual void WriteStyleAttribute (string name, string value, bool fEncode)
{
Write (name);
Write (StyleEqualsChar);
Write (EncodeAttributeValue (value, fEncode));
Write (SemicolonChar);
}
public override void Write (char [] buffer, int index, int count)
{
OutputTabs ();
b.Write (buffer, index, count);
}
public override void Write (double value)
{
OutputTabs ();
b.Write (value);
}
public override void Write (char value)
{
OutputTabs ();
b.Write (value);
}
public override void Write (char [] buffer)
{
OutputTabs ();
b.Write (buffer);
}
public override void Write (int value)
{
OutputTabs ();
b.Write (value);
}
public override void Write (string format, object arg0)
{
OutputTabs ();
b.Write (format, arg0);
}
public override void Write (string format, object arg0, object arg1)
{
OutputTabs ();
b.Write (format, arg0, arg1);
}
public override void Write (string format, params object [] args)
{
OutputTabs ();
b.Write (format, args);
}
public override void Write (string s)
{
OutputTabs ();
b.Write (s);
}
public override void Write (long value)
{
OutputTabs ();
b.Write (value);
}
public override void Write (object value)
{
OutputTabs ();
b.Write (value);
}
public override void Write (float value)
{
OutputTabs ();
b.Write (value);
}
public override void Write (bool value)
{
OutputTabs ();
b.Write (value);
}
public virtual void WriteAttribute (string name, string value)
{
WriteAttribute (name, value, false);
}
public override void WriteLine (char value)
{
OutputTabs ();
b.WriteLine (value);
newline = true;
}
public override void WriteLine (long value)
{
OutputTabs ();
b.WriteLine (value);
newline = true;
}
public override void WriteLine (object value)
{
OutputTabs ();
b.WriteLine (value);
newline = true;
}
public override void WriteLine (double value)
{
OutputTabs ();
b.WriteLine (value);
newline = true;
}
public override void WriteLine (char [] buffer, int index, int count)
{
OutputTabs ();
b.WriteLine (buffer, index, count);
newline = true;
}
public override void WriteLine (char [] buffer)
{
OutputTabs ();
b.WriteLine (buffer);
newline = true;
}
public override void WriteLine (bool value)
{
OutputTabs ();
b.WriteLine (value);
newline = true;
}
public override void WriteLine ()
{
OutputTabs ();
b.WriteLine ();
newline = true;
}
public override void WriteLine (int value)
{
OutputTabs ();
b.WriteLine (value);
newline = true;
}
public override void WriteLine (string format, object arg0, object arg1)
{
OutputTabs ();
b.WriteLine (format, arg0, arg1);
newline = true;
}
public override void WriteLine (string format, object arg0)
{
OutputTabs ();
b.WriteLine (format, arg0);
newline = true;
}
public override void WriteLine (string format, params object [] args)
{
OutputTabs ();
b.WriteLine (format, args);
newline = true;
}
[CLSCompliant (false)]
public override void WriteLine (uint value)
{
OutputTabs ();
b.WriteLine (value);
newline = true;
}
public override void WriteLine (string s)
{
OutputTabs ();
b.WriteLine (s);
newline = true;
}
public override void WriteLine (float value)
{
OutputTabs ();
b.WriteLine (value);
newline = true;
}
public void WriteLineNoTabs (string s)
{
b.WriteLine (s);
newline = true;
}
public override Encoding Encoding {
get {
return b.Encoding;
}
}
int indent;
public int Indent {
get {
return indent;
}
set {
indent = value;
}
}
public System.IO.TextWriter InnerWriter {
get {
return b;
}
set {
b = value;
}
}
public override string NewLine {
get {
return b.NewLine;
}
set {
b.NewLine = value;
}
}
protected HtmlTextWriterTag TagKey {
get {
if (tagstack_pos == -1)
throw new InvalidOperationException ();
return tagstack [tagstack_pos].key;
}
set {
#if TARGET_JVM
if (tagstack [tagstack_pos] == null)
tagstack [tagstack_pos] = new AddedTag ();
#endif
tagstack [tagstack_pos].key = value;
tagstack [tagstack_pos].name = GetTagName (value);
}
}
protected string TagName {
get {
if (tagstack_pos == -1)
throw new InvalidOperationException ();
return tagstack [tagstack_pos].name;
}
set {
#if TARGET_JVM
if (tagstack [tagstack_pos] == null)
tagstack [tagstack_pos] = new AddedTag ();
#endif
tagstack [tagstack_pos].name = value;
tagstack [tagstack_pos].key = GetTagKey (value);
if (tagstack [tagstack_pos].key != HtmlTextWriterTag.Unknown)
tagstack [tagstack_pos].name = GetTagName (tagstack [tagstack_pos].key);
}
}
TextWriter b;
string tab_string;
bool newline;
//
// These emulate generic Stack <T>, since we can't use that ;-(. _pos is the current
// element.IE, you edit blah [blah_pos]. I *really* want generics, sigh.
//
AddedStyle [] styles;
AddedAttr [] attrs;
AddedTag [] tagstack;
int styles_pos = -1, attrs_pos = -1, tagstack_pos = -1;
#if TARGET_JVM
class
#else
struct
#endif
AddedTag {
public string name;
public HtmlTextWriterTag key;
}
#if TARGET_JVM
class
#else
struct
#endif
AddedStyle {
public string name;
public HtmlTextWriterStyle key;
public string value;
}
#if TARGET_JVM
class
#else
struct
#endif
AddedAttr {
public string name;
public HtmlTextWriterAttribute key;
public string value;
}
void NextStyleStack ()
{
if (styles == null)
styles = new AddedStyle [16];
if (++styles_pos < styles.Length)
return;
int nsize = styles.Length * 2;
AddedStyle [] ncontents = new AddedStyle [nsize];
Array.Copy (styles, ncontents, styles.Length);
styles = ncontents;
}
void NextAttrStack ()
{
if (attrs == null)
attrs = new AddedAttr [16];
if (++attrs_pos < attrs.Length)
return;
int nsize = attrs.Length * 2;
AddedAttr [] ncontents = new AddedAttr [nsize];
Array.Copy (attrs, ncontents, attrs.Length);
attrs = ncontents;
}
void NextTagStack ()
{
if (tagstack == null)
tagstack = new AddedTag [16];
if (++tagstack_pos < tagstack.Length)
return;
int nsize = tagstack.Length * 2;
AddedTag [] ncontents = new AddedTag [nsize];
Array.Copy (tagstack, ncontents, tagstack.Length);
tagstack = ncontents;
}
public const string DefaultTabString = "\t";
public const char DoubleQuoteChar = '"';
public const string EndTagLeftChars = "</";
public const char EqualsChar = '=';
public const string EqualsDoubleQuoteString = "=\"";
public const string SelfClosingChars = " /";
public const string SelfClosingTagEnd = " />";
public const char SemicolonChar = ';';
public const char SingleQuoteChar = '\'';
public const char SlashChar = '/';
public const char SpaceChar = ' ';
public const char StyleEqualsChar = ':';
public const char TagLeftChar = '<';
public const char TagRightChar = '>';
enum TagType {
Block,
Inline,
SelfClosing,
}
sealed class HtmlTag {
readonly public HtmlTextWriterTag key;
readonly public string name;
readonly public TagType tag_type;
public HtmlTag (HtmlTextWriterTag k, string n, TagType tt)
{
key = k;
name = n;
tag_type = tt;
}
}
sealed class HtmlStyle {
readonly public HtmlTextWriterStyle key;
readonly public string name;
public HtmlStyle (HtmlTextWriterStyle k, string n)
{
key = k;
name = n;
}
}
sealed class HtmlAttribute {
readonly public HtmlTextWriterAttribute key;
readonly public string name;
public HtmlAttribute (HtmlTextWriterAttribute k, string n)
{
key = k;
name = n;
}
}
static HtmlTag [] tags = {
new HtmlTag (HtmlTextWriterTag.Unknown, "", TagType.Block),
new HtmlTag (HtmlTextWriterTag.A, "a", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Acronym, "acronym", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Address, "address", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Area, "area", TagType.Block),
new HtmlTag (HtmlTextWriterTag.B, "b", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Base, "base", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Basefont, "basefont", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Bdo, "bdo", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Bgsound, "bgsound", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Big, "big", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Blockquote, "blockquote", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Body, "body", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Br, "br", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Button, "button", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Caption, "caption", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Center, "center", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Cite, "cite", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Code, "code", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Col, "col", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Colgroup, "colgroup", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Dd, "dd", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Del, "del", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Dfn, "dfn", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Dir, "dir", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Div, "div", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Dl, "dl", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Dt, "dt", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Em, "em", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Embed, "embed", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Fieldset, "fieldset", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Font, "font", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Form, "form", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Frame, "frame", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Frameset, "frameset", TagType.Block),
new HtmlTag (HtmlTextWriterTag.H1, "h1", TagType.Block),
new HtmlTag (HtmlTextWriterTag.H2, "h2", TagType.Block),
new HtmlTag (HtmlTextWriterTag.H3, "h3", TagType.Block),
new HtmlTag (HtmlTextWriterTag.H4, "h4", TagType.Block),
new HtmlTag (HtmlTextWriterTag.H5, "h5", TagType.Block),
new HtmlTag (HtmlTextWriterTag.H6, "h6", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Head, "head", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Hr, "hr", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Html, "html", TagType.Block),
new HtmlTag (HtmlTextWriterTag.I, "i", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Iframe, "iframe", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Img, "img", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Input, "input", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Ins, "ins", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Isindex, "isindex", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Kbd, "kbd", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Label, "label", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Legend, "legend", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Li, "li", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Link, "link", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Map, "map", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Marquee, "marquee", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Menu, "menu", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Meta, "meta", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Nobr, "nobr", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Noframes, "noframes", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Noscript, "noscript", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Object, "object", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Ol, "ol", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Option, "option", TagType.Block),
new HtmlTag (HtmlTextWriterTag.P, "p", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Param, "param", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Pre, "pre", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Q, "q", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Rt, "rt", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Ruby, "ruby", TagType.Block),
new HtmlTag (HtmlTextWriterTag.S, "s", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Samp, "samp", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Script, "script", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Select, "select", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Small, "small", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Span, "span", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Strike, "strike", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Strong, "strong", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Style, "style", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Sub, "sub", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Sup, "sup", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Table, "table", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Tbody, "tbody", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Td, "td", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Textarea, "textarea", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Tfoot, "tfoot", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Th, "th", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Thead, "thead", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Title, "title", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Tr, "tr", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Tt, "tt", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.U, "u", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Ul, "ul", TagType.Block),
new HtmlTag (HtmlTextWriterTag.Var, "var", TagType.Inline),
new HtmlTag (HtmlTextWriterTag.Wbr, "wbr", TagType.SelfClosing),
new HtmlTag (HtmlTextWriterTag.Xml, "xml", TagType.Block),
};
static HtmlAttribute [] htmlattrs = {
new HtmlAttribute (HtmlTextWriterAttribute.Accesskey, "accesskey"),
new HtmlAttribute (HtmlTextWriterAttribute.Align, "align"),
new HtmlAttribute (HtmlTextWriterAttribute.Alt, "alt"),
new HtmlAttribute (HtmlTextWriterAttribute.Background, "background"),
new HtmlAttribute (HtmlTextWriterAttribute.Bgcolor, "bgcolor"),
new HtmlAttribute (HtmlTextWriterAttribute.Border, "border"),
new HtmlAttribute (HtmlTextWriterAttribute.Bordercolor, "bordercolor"),
new HtmlAttribute (HtmlTextWriterAttribute.Cellpadding, "cellpadding"),
new HtmlAttribute (HtmlTextWriterAttribute.Cellspacing, "cellspacing"),
new HtmlAttribute (HtmlTextWriterAttribute.Checked, "checked"),
new HtmlAttribute (HtmlTextWriterAttribute.Class, "class"),
new HtmlAttribute (HtmlTextWriterAttribute.Cols, "cols"),
new HtmlAttribute (HtmlTextWriterAttribute.Colspan, "colspan"),
new HtmlAttribute (HtmlTextWriterAttribute.Disabled, "disabled"),
new HtmlAttribute (HtmlTextWriterAttribute.For, "for"),
new HtmlAttribute (HtmlTextWriterAttribute.Height, "height"),
new HtmlAttribute (HtmlTextWriterAttribute.Href, "href"),
new HtmlAttribute (HtmlTextWriterAttribute.Id, "id"),
new HtmlAttribute (HtmlTextWriterAttribute.Maxlength, "maxlength"),
new HtmlAttribute (HtmlTextWriterAttribute.Multiple, "multiple"),
new HtmlAttribute (HtmlTextWriterAttribute.Name, "name"),
new HtmlAttribute (HtmlTextWriterAttribute.Nowrap, "nowrap"),
new HtmlAttribute (HtmlTextWriterAttribute.Onchange, "onchange"),
new HtmlAttribute (HtmlTextWriterAttribute.Onclick, "onclick"),
new HtmlAttribute (HtmlTextWriterAttribute.ReadOnly, "readonly"),
new HtmlAttribute (HtmlTextWriterAttribute.Rows, "rows"),
new HtmlAttribute (HtmlTextWriterAttribute.Rowspan, "rowspan"),
new HtmlAttribute (HtmlTextWriterAttribute.Rules, "rules"),
new HtmlAttribute (HtmlTextWriterAttribute.Selected, "selected"),
new HtmlAttribute (HtmlTextWriterAttribute.Size, "size"),
new HtmlAttribute (HtmlTextWriterAttribute.Src, "src"),
new HtmlAttribute (HtmlTextWriterAttribute.Style, "style"),
new HtmlAttribute (HtmlTextWriterAttribute.Tabindex, "tabindex"),
new HtmlAttribute (HtmlTextWriterAttribute.Target, "target"),
new HtmlAttribute (HtmlTextWriterAttribute.Title, "title"),
new HtmlAttribute (HtmlTextWriterAttribute.Type, "type"),
new HtmlAttribute (HtmlTextWriterAttribute.Valign, "valign"),
new HtmlAttribute (HtmlTextWriterAttribute.Value, "value"),
new HtmlAttribute (HtmlTextWriterAttribute.Width, "width"),
new HtmlAttribute (HtmlTextWriterAttribute.Wrap, "wrap"),
#if NET_2_0
new HtmlAttribute (HtmlTextWriterAttribute.Abbr, "abbr"),
new HtmlAttribute (HtmlTextWriterAttribute.AutoComplete, "autocomplete"),
new HtmlAttribute (HtmlTextWriterAttribute.Axis, "axis"),
new HtmlAttribute (HtmlTextWriterAttribute.Content, "content"),
new HtmlAttribute (HtmlTextWriterAttribute.Coords, "coords"),
new HtmlAttribute (HtmlTextWriterAttribute.DesignerRegion, "_designerregion"),
new HtmlAttribute (HtmlTextWriterAttribute.Dir, "dir"),
new HtmlAttribute (HtmlTextWriterAttribute.Headers, "headers"),
new HtmlAttribute (HtmlTextWriterAttribute.Longdesc, "longdesc"),
new HtmlAttribute (HtmlTextWriterAttribute.Rel, "rel"),
new HtmlAttribute (HtmlTextWriterAttribute.Scope, "scope"),
new HtmlAttribute (HtmlTextWriterAttribute.Shape, "shape"),
new HtmlAttribute (HtmlTextWriterAttribute.Usemap, "usemap"),
new HtmlAttribute (HtmlTextWriterAttribute.VCardName, "vcard_name"),
#endif
};
static HtmlStyle [] htmlstyles = {
new HtmlStyle (HtmlTextWriterStyle.BackgroundColor, "background-color"),
new HtmlStyle (HtmlTextWriterStyle.BackgroundImage, "background-image"),
new HtmlStyle (HtmlTextWriterStyle.BorderCollapse, "border-collapse"),
new HtmlStyle (HtmlTextWriterStyle.BorderColor, "border-color"),
new HtmlStyle (HtmlTextWriterStyle.BorderStyle, "border-style"),
new HtmlStyle (HtmlTextWriterStyle.BorderWidth, "border-width"),
new HtmlStyle (HtmlTextWriterStyle.Color, "color"),
new HtmlStyle (HtmlTextWriterStyle.FontFamily, "font-family"),
new HtmlStyle (HtmlTextWriterStyle.FontSize, "font-size"),
new HtmlStyle (HtmlTextWriterStyle.FontStyle, "font-style"),
new HtmlStyle (HtmlTextWriterStyle.FontWeight, "font-weight"),
new HtmlStyle (HtmlTextWriterStyle.Height, "height"),
new HtmlStyle (HtmlTextWriterStyle.TextDecoration, "text-decoration"),
new HtmlStyle (HtmlTextWriterStyle.Width, "width"),
#if NET_2_0
new HtmlStyle (HtmlTextWriterStyle.ListStyleImage, "list-style-image"),
new HtmlStyle (HtmlTextWriterStyle.ListStyleType, "list-style-type"),
new HtmlStyle (HtmlTextWriterStyle.Cursor, "cursor"),
new HtmlStyle (HtmlTextWriterStyle.Direction, "direction"),
new HtmlStyle (HtmlTextWriterStyle.Display, "display"),
new HtmlStyle (HtmlTextWriterStyle.Filter, "filter"),
new HtmlStyle (HtmlTextWriterStyle.FontVariant, "font-variant"),
new HtmlStyle (HtmlTextWriterStyle.Left, "left"),
new HtmlStyle (HtmlTextWriterStyle.Margin, "margin"),
new HtmlStyle (HtmlTextWriterStyle.MarginBottom, "margin-bottom"),
new HtmlStyle (HtmlTextWriterStyle.MarginLeft, "margin-left"),
new HtmlStyle (HtmlTextWriterStyle.MarginRight, "margin-right"),
new HtmlStyle (HtmlTextWriterStyle.MarginTop, "margin-top"),
new HtmlStyle (HtmlTextWriterStyle.Overflow, "overflow"),
new HtmlStyle (HtmlTextWriterStyle.OverflowX, "overflow-x"),
new HtmlStyle (HtmlTextWriterStyle.OverflowY, "overflow-y"),
new HtmlStyle (HtmlTextWriterStyle.Padding, "padding"),
new HtmlStyle (HtmlTextWriterStyle.PaddingBottom, "padding-bottom"),
new HtmlStyle (HtmlTextWriterStyle.PaddingLeft, "padding-left"),
new HtmlStyle (HtmlTextWriterStyle.PaddingRight, "padding-right"),
new HtmlStyle (HtmlTextWriterStyle.PaddingTop, "padding-top"),
new HtmlStyle (HtmlTextWriterStyle.Position, "position"),
new HtmlStyle (HtmlTextWriterStyle.TextAlign, "text-align"),
new HtmlStyle (HtmlTextWriterStyle.VerticalAlign, "vertical-align"),
new HtmlStyle (HtmlTextWriterStyle.TextOverflow, "text-overflow"),
new HtmlStyle (HtmlTextWriterStyle.Top, "top"),
new HtmlStyle (HtmlTextWriterStyle.Visibility, "visibility"),
new HtmlStyle (HtmlTextWriterStyle.WhiteSpace, "white-space"),
new HtmlStyle (HtmlTextWriterStyle.ZIndex, "z-index"),
#endif
};
#if NET_2_0
public virtual bool IsValidFormAttribute (string attribute)
{
return true;
}
// writes <br />
public virtual void WriteBreak ()
{
string br = GetTagName (HtmlTextWriterTag.Br);
WriteBeginTag (br);
Write (SelfClosingTagEnd);
}
public virtual void WriteEncodedText (string text)
{
Write (HttpUtility.HtmlEncode (text));
}
[MonoNotSupported ("")]
public virtual void WriteEncodedUrl (string url)
{
// WriteUrlEncodedString (url, false);
throw new NotImplementedException ();
}
[MonoNotSupported ("")]
public virtual void WriteEncodedUrlParameter (string urlText)
{
// WriteUrlEncodedString (urlText, true);
throw new NotImplementedException ();
}
[MonoNotSupported ("")]
protected void WriteUrlEncodedString (string text, bool argument)
{
throw new NotImplementedException ();
}
[MonoNotSupported ("")]
public virtual void EnterStyle (Style style)
{
throw new NotImplementedException ();
}
[MonoNotSupported ("")]
public virtual void EnterStyle (Style style, HtmlTextWriterTag tag)
{
throw new NotImplementedException ();
}
[MonoNotSupported ("")]
public virtual void ExitStyle (Style style)
{
throw new NotImplementedException ();
}
[MonoNotSupported ("")]
public virtual void ExitStyle (Style style, HtmlTextWriterTag tag)
{
throw new NotImplementedException ();
}
public virtual void BeginRender ()
{
}
public virtual void EndRender ()
{
}
#endif
}
}