mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
* System.Web.build: removed some more excludes. * System.Web.Hosting/AppDomainFactory.cs: * System.Web.Hosting/IAppDomainFactory.cs: * System.Web.Hosting/IISAPIRuntime.cs: * System.Web.Hosting/ISAPIRuntime.cs: make them compile. * System.Web.UI/AttributeCollection.cs: added CssStyleCollection. * System.Web.UI/CssStyleCollection.cs: use a StateBag instead of a Hashtable. Added internal .ctor. * System.Web.UI/DataBinding.cs: propertyType is a Type. Implemented Equals and GetHashCode. * System.Web.UI/DataBoundLiteralControl.cs: (LoadViewState): (SaveViewState): implemented. * System.Web.UI/Page.cs: FileDependencies is not public. * System.Web.UI/ParseChildrenAttribute.cs: give a value to Default. (GetHashCode): (Equals): (IsDefaultAttribute): implemented. svn path=/trunk/mcs/; revision=5743
81 lines
1.7 KiB
C#
Executable File
81 lines
1.7 KiB
C#
Executable File
//
|
|
// System.Web.UI.DataBoundLiteralCOntrol.cs
|
|
//
|
|
// Authors:
|
|
// Duncan Mak ([email protected])
|
|
// Gonzalo Paniagua Javier ([email protected])
|
|
//
|
|
// (C) 2002 Ximian, Inc. (http://www.ximian.com)
|
|
//
|
|
|
|
using System;
|
|
using System.Text;
|
|
|
|
namespace System.Web.UI {
|
|
|
|
public sealed class DataBoundLiteralControl : Control
|
|
{
|
|
private string [] staticLiterals;
|
|
private string [] dataBoundLiterals;
|
|
|
|
public DataBoundLiteralControl (int staticLiteralsCount,
|
|
int dataBoundLiteralCount)
|
|
{
|
|
staticLiterals = new string [staticLiteralsCount];
|
|
dataBoundLiterals = new string [dataBoundLiteralCount];
|
|
PreventAutoID ();
|
|
}
|
|
|
|
public string Text {
|
|
get {
|
|
StringBuilder text = new StringBuilder ();
|
|
int stLength = staticLiterals.Length;
|
|
int dbLength = dataBoundLiterals.Length;
|
|
int max = (stLength > dbLength) ? stLength : dbLength;
|
|
for (int i = 0; i < max; i++){
|
|
if (i < stLength)
|
|
text.Append (staticLiterals [i]);
|
|
if (i < dbLength)
|
|
text.Append (dataBoundLiterals [i]);
|
|
}
|
|
|
|
return text.ToString ();
|
|
}
|
|
}
|
|
|
|
protected override ControlCollection CreateControlCollection ()
|
|
{
|
|
return new EmptyControlCollection (this);
|
|
}
|
|
|
|
protected override void LoadViewState (object savedState)
|
|
{
|
|
if (savedState != null)
|
|
dataBoundLiterals = (string []) savedState;
|
|
}
|
|
|
|
protected override void Render (HtmlTextWriter output)
|
|
{
|
|
output.Write (Text);
|
|
}
|
|
|
|
protected override object SaveViewState ()
|
|
{
|
|
if (dataBoundLiterals.Length == 0)
|
|
return null;
|
|
return dataBoundLiterals;
|
|
}
|
|
|
|
public void SetDataBoundString (int index, string s)
|
|
{
|
|
dataBoundLiterals [index] = s;
|
|
}
|
|
|
|
public void SetStaticString (int index, string s)
|
|
{
|
|
staticLiterals [index] = s;
|
|
}
|
|
}
|
|
}
|
|
|