diff options
author | Duncan Mak <duncan@mono-cvs.ximian.com> | 2002-05-18 00:54:14 +0400 |
---|---|---|
committer | Duncan Mak <duncan@mono-cvs.ximian.com> | 2002-05-18 00:54:14 +0400 |
commit | b3976280add44f88ddcb5a2cf67cae5ced5eb9ba (patch) | |
tree | 34b18e1f3a2f01c859789b4500e48399f55538de /mcs/class/System.Web | |
parent | cfc4b4b32a89c078cd03a343ba576c35b51fd7d7 (diff) |
2002-05-17 Duncan Mak <duncan@ximian.com>
* System.Web.build: Added new arguments: "/noconfig",
"/r:System.Drawing.dll" and "/r:System.Xml.dll".
* AttributeCollection.cs:
* ControlCollection.cs:
* CssStyleCollection.cs:
* DataBindingCollection.cs:
* EmptyControlCollection.cs: Added missing Collection classes.
* BaseParser.cs:
* TemplateParser.cs: Implemented. BaseParser is weird because
there is no documentation on what it does.
* ControlBuilder.cs:
* DataBinder.cs:
* DataBinding.cs: Added.
* DataBoundLiteralControl.cs:
* Triplet.cs: Added.
* RenderMethod.cs: Added this delegate for Control.cs
svn path=/trunk/mcs/; revision=4726
Diffstat (limited to 'mcs/class/System.Web')
17 files changed, 917 insertions, 0 deletions
diff --git a/mcs/class/System.Web/ChangeLog b/mcs/class/System.Web/ChangeLog index 4a459c3cf3d..0e08518c192 100644 --- a/mcs/class/System.Web/ChangeLog +++ b/mcs/class/System.Web/ChangeLog @@ -1,3 +1,8 @@ +2002-05-17 Duncan Mak <duncan@ximian.com> + + * System.Web.build: Added new arguments: "/noconfig", + "/r:System.Drawing.dll" and "/r:System.Xml.dll". + 2002-05-10 Duncan Mak <duncan@ximian.com> * System.Web.build: Include the System.Web.UI.HtmlControls namespace. diff --git a/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs b/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs new file mode 100755 index 00000000000..274c1ab5feb --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs @@ -0,0 +1,76 @@ +// +// System.Web.UI.AttributeCollection.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; +using System.Collections; + +namespace System.Web.UI { + + public sealed class AttributeCollection + { + StateBag bag; + Hashtable list; + + public AttributeCollection (StateBag bag) + { + this.bag = bag; + list = new Hashtable (); + } + + public int Count { + get { return list.Count; } + } + + [MonoTODO] + public CssStyleCollection CssStyle { + get { return null; } + } + + public string this [string key] { + get { return list [key] as string; } + + set { list [key] = value; } + } + + public ICollection Keys { + get { return list.Keys; } + } + + public void Add (string key, string value) + { + list.Add (key, value); + } + + public void AddAttributes (HtmlTextWriter writer) + { + foreach (object key in list.Keys) { + + object value = list [key]; + writer.AddAttribute ((string) key, (string) value); + } + } + + public void Clear () + { + list.Clear (); + } + + public void Remove (string key) + { + list.Remove (key); + } + + public void Render (HtmlTextWriter writer) + { + foreach (object key in list.Keys) { + object value = list [key]; + writer.WriteAttribute ((string) key, (string) value); + } + } + } +} diff --git a/mcs/class/System.Web/System.Web.UI/BaseParser.cs b/mcs/class/System.Web/System.Web.UI/BaseParser.cs new file mode 100755 index 00000000000..981cc5d0828 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/BaseParser.cs @@ -0,0 +1,14 @@ +// +// System.Web.UI.BaseParser.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +namespace System.Web.UI { + public class BaseParser + { + // LAMESPEC: We know nothing about this class from the docs. + } +} diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog index fa82d782cad..5e6331fa5dc 100644 --- a/mcs/class/System.Web/System.Web.UI/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI/ChangeLog @@ -1,3 +1,27 @@ +2002-05-17 Duncan Mak <duncan@ximian.com> + + * AttributeCollection.cs: + * ControlCollection.cs: + * CssStyleCollection.cs: + * DataBindingCollection.cs: + * EmptyControlCollection.cs: Added missing Collection classes. + +2002-05-17 Duncan Mak <duncan@ximian.com> + + * BaseParser.cs: + * TemplateParser.cs: Implemented. BaseParser is weird because + there is no documentation on what it does. + + * ControlBuilder.cs: + + * DataBinder.cs: + * DataBinding.cs: Added. + + * DataBoundLiteralControl.cs: + * Triplet.cs: Added. + + * RenderMethod.cs: Added this delegate for Control.cs + 2002-05-15 Gonzalo Paniagua Javier <gonzalo@ximian.com> * ValidationPropertyAttribute.cs: a couple of fixes to make it compile. diff --git a/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs b/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs new file mode 100755 index 00000000000..7acb206a3a3 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs @@ -0,0 +1,167 @@ +// +// System.Web.UI.ControlBuilder.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; +using System.Collections; + +namespace System.Web.UI { + + public class ControlBuilder + { + TemplateParser parser; + ControlBuilder parentBuilder; + Type type; + string tagName; + string id; + IDictionary attribs; + int line; + string fileName; + + public ControlBuilder () + { + } + + + internal ControlBuilder ( + TemplateParser parser, ControlBuilder parentBuilder, + Type type, string tagName, string id, + IDictionary attribs, int line, string sourceFileName) + + { + this.parser = parser; + this.parentBuilder = parentBuilder; + this.type = type; + this.tagName = tagName; + this.id = id; + this.attribs = attribs; + this.line = line; + this.fileName = sourceFileName; + } + + public Type ControlType { + get { return type; } + } + + [MonoTODO] + public bool FChildrenAsProperties { + get { return false; } + } + + [MonoTODO] + public bool FIsNonParserAccessor { + get { return false; } + } + + [MonoTODO] + public bool HasAspCode { + get { return false; } + } + + public string ID { + get { return id; } + + set { id = value; } + } + + [MonoTODO] + public bool InDesigner { + get { return false; } + } + + [MonoTODO] + public Type NamingContainerType { + get { return null; } + } + + protected TemplateParser Parser { + get { return parser; } + } + + public string TagName { + get { return tagName; } + } + + [MonoTODO] + public virtual bool AllowWhitespaceLiterals () + { + return false; + } + + [MonoTODO] + public virtual void AppendLiteralString (string s) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void AppendSubBuilder (ControlBuilder subBuilder) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void CloseControl () + { + } + + [MonoTODO] + public static ControlBuilder CreateBuilderFromType ( + TemplateParser parser, ControlBuilder parentBuilder, + Type type, string tagName, string id, + IDictionary attribs, int line, string sourceFileName) + { + return new ControlBuilder (parser, parentBuilder, type, + tagName, id, attribs, line, sourceFileName); + } + + [MonoTODO] + public virtual Type GetChildControlType (string tagName, IDictionary attribs) + { + return attribs [tagName] as Type; + } + + [MonoTODO] + public virtual bool HasBody () + { + return false; + } + + [MonoTODO] + public virtual bool HtmlDecodeLiterals () + { + return false; + } + + [MonoTODO] + public virtual void Init ( + TemplateParser parser, ControlBuilder parentBuilder, + Type type, string tagName, string id, IDictionary attribs) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual bool NeedsTagInnerText () + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void OnAppendToParentBuilder () + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual void SetTagInnerText (string text) + { + throw new NotImplementedException (); + } + } +} + diff --git a/mcs/class/System.Web/System.Web.UI/ControlCollection.cs b/mcs/class/System.Web/System.Web.UI/ControlCollection.cs new file mode 100755 index 00000000000..ce03e58b1b2 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/ControlCollection.cs @@ -0,0 +1,113 @@ +// +// System.Web.UI.ControlCollection.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; +using System.Collections; + +namespace System.Web.UI { + + public class ControlCollection : ICollection, IEnumerable + { + ArrayList list = new ArrayList (); + Control owner; + + public ControlCollection (Control owner) + { + if (owner == null) + throw new ArgumentException (); + + this.owner = owner; + } + + public int Count { + get { return list.Count; } + } + + public bool IsReadOnly { + get { return list.IsReadOnly; } + } + + public bool IsSynchronized { + get { return list.IsSynchronized; } + } + + public virtual Control this [int index] { + get { return list [index] as Control; } + } + + protected Control Owner { + get { return owner; } + } + + public object SyncRoot { + get { return list.SyncRoot; } + } + + public virtual void Add (Control child) + { + if (child == null) + throw new ArgumentNullException (); + if (IsReadOnly) + throw new HttpException (); + + list.Add (child); + } + + public virtual void AddAt (int index, Control child) + { + if (child == null) // maybe we should check for ! (child is Control)? + throw new ArgumentNullException (); + + if ((index < 0) || (index > Count)) + throw new ArgumentOutOfRangeException (); + + if (IsReadOnly) + throw new HttpException (); + + list [index] = child; + } + + public virtual void Clear () + { + list.Clear (); + } + + public virtual bool Contains (Control c) + { + return list.Contains (c as object); + } + + public void CopyTo (Array array, int index) + { + list.CopyTo (array, index); + } + + public IEnumerator GetEnumerator () + { + return list.GetEnumerator (); + } + + public virtual int IndexOf (Control c) + { + return list.IndexOf (c as object); + } + + public virtual void Remove (Control value) + { + list.Remove (value as object); + } + + public virtual void RemoveAt (int index) + { + if (IsReadOnly) + throw new HttpException (); + + list.RemoveAt (index); + } + } +} diff --git a/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs b/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs new file mode 100755 index 00000000000..bcf88bbc436 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs @@ -0,0 +1,48 @@ +// +// System.Web.UI.CssStyleCollection.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; +using System.Collections; + +namespace System.Web.UI { + + public sealed class CssStyleCollection + { + Hashtable list = new Hashtable (); + + public int Count { + get { return list.Count; } + } + + public string this [string key] { + + get { return list [key] as string; } + + set { list [key] = value; } + } + + public ICollection Keys { + get { return list.Keys; } + } + + public void Add (string key, string value) + { + list.Add (key, value); + } + + public void Clear () + { + list.Clear (); + } + + public void Remove (string key) + { + list.Remove (key); + } + } +} diff --git a/mcs/class/System.Web/System.Web.UI/DataBinder.cs b/mcs/class/System.Web/System.Web.UI/DataBinder.cs new file mode 100755 index 00000000000..6aa5ab9e64a --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/DataBinder.cs @@ -0,0 +1,55 @@ +// +// System.Web.UI.DataBinder.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; + +namespace System.Web.UI { + + public sealed class DataBinder + { + public DataBinder () + { + } + + [MonoTODO] + public static object Eval (object container, string expression) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public static object Eval (object container, string expression, string format) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public static object GetIndexedPropertyValue (object container, string expr) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public static object GetIndexedPropertyValue (object container, string expr, string format) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public static string GetPropertyValue (object container, string propName) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public static string GetPropertyValue (object container, string propName, string format) + { + throw new NotImplementedException (); + } + } +} diff --git a/mcs/class/System.Web/System.Web.UI/DataBinding.cs b/mcs/class/System.Web/System.Web.UI/DataBinding.cs new file mode 100755 index 00000000000..4acf0b8a088 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/DataBinding.cs @@ -0,0 +1,52 @@ +// +// System.Web.UI.DataBinding.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; + +namespace System.Web.UI { + + public sealed class DataBinding + { + string propertyName; + string propertyType; + string expression; + + public DataBinding (string propertyName, string propertyType, + string expression) + { + this.propertyName = propertyName; + this.propertyType = propertyType; + this.expression = expression; + } + + public string Expression { + get { return expression; } + } + + public string PropertyName { + get { return propertyName; } + } + + public string PropertyType { + get { return propertyType; } + } + + public override bool Equals (object obj) + { + if (((DataBinding) obj).PropertyName == this.PropertyName) + return true; + else + return false; + } + + public override int GetHashCode () + { + return propertyName.GetHashCode (); + } + } +} diff --git a/mcs/class/System.Web/System.Web.UI/DataBindingCollection.cs b/mcs/class/System.Web/System.Web.UI/DataBindingCollection.cs new file mode 100755 index 00000000000..80e86454612 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/DataBindingCollection.cs @@ -0,0 +1,92 @@ +// +// System.Web.UI.DataBindingCollection.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; +using System.Collections; + +namespace System.Web.UI { + + public sealed class DataBindingCollection : ICollection, IEnumerable + { + Hashtable list; + ArrayList removed; + + public DataBindingCollection () + { + list = new Hashtable (); + removed = new ArrayList (); + } + + public int Count { + get { return list.Count; } + } + + public bool IsReadOnly { + get { return list.IsReadOnly; } + } + + public bool IsSynchronized { + get { return list.IsSynchronized; } + } + + public DataBinding this [string propertyName] { + get { return list [propertyName] as DataBinding; } + } + + public string [] RemovedBindings { + get { return (string []) removed.ToArray (typeof (string)); } + } + + public object SyncRoot { + get { return list.SyncRoot; } + } + + public void Add (DataBinding binding) + { + list.Add (binding.PropertyName, binding); + } + + public void Clear () + { + list.Clear (); + } + + public void CopyTo (Array array, int index) + { + list.CopyTo (array, index); + } + + public IEnumerator GetEnumerator () + { + return list.GetEnumerator (); + } + + public void Remove (DataBinding binding) + { + string key = binding.PropertyName; + Remove (key); + } + + public void Remove (string propertyName) + { + removed.Add (propertyName); + list.Remove (propertyName); + } + + public void Remove (string propertyName, + bool addToRemovedList) + { + if (addToRemovedList) + removed.Add (String.Empty); // LAMESPEC + else + removed.Add (propertyName); + + list.Remove (propertyName); + } + } +} diff --git a/mcs/class/System.Web/System.Web.UI/DataBoundLiteralControl.cs b/mcs/class/System.Web/System.Web.UI/DataBoundLiteralControl.cs new file mode 100755 index 00000000000..933eefdce2a --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/DataBoundLiteralControl.cs @@ -0,0 +1,57 @@ +// +// System.Web.UI.DataBoundLiteralCOntrol.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; +using System.Web.UI; + +namespace System.Web.UI { + + public sealed class DataBoundLiteralControl : Control + { + public DataBoundLiteralControl (int staticLiteralsCount, + int dataBOundLiteralCount) + { + } + + [MonoTODO] + public string Text { + get { return String.Empty; } + } + + [MonoTODO] + protected override ControlCollection CreateControlCollection () + { + throw new NotImplementedException (); + } + + protected override void LoadViewState (object savedState) + { + throw new NotImplementedException (); + } + + protected override void Render (HtmlTextWriter output) + { + throw new NotImplementedException (); + } + + protected override object SaveViewState () + { + throw new NotImplementedException (); + } + + public void SetDataBoundString (int index, string s) + { + throw new NotImplementedException (); + } + + public void SetStaticString (int index, string s) + { + throw new NotImplementedException (); + } + } +} diff --git a/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs b/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs new file mode 100755 index 00000000000..3bf0ec4f731 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs @@ -0,0 +1,30 @@ +// +// System.Web.UI.EmptyControlCollection.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; + +namespace System.Web.UI { + + public class EmptyControlCollection : ControlCollection + { + public EmptyControlCollection (Control owner) + : base (owner) + { + } + + public override void Add (Control child) + { + throw new HttpException (); + } + + public override void AddAt (int index, Control child) + { + throw new HttpException (); + } + } +} diff --git a/mcs/class/System.Web/System.Web.UI/RenderMethod.cs b/mcs/class/System.Web/System.Web.UI/RenderMethod.cs new file mode 100755 index 00000000000..8f2db742cdb --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/RenderMethod.cs @@ -0,0 +1,13 @@ +// +// +// System.Web.UI.RenderMethod.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +namespace System.Web.UI { + + public delegate void RenderMethod (HtmlTextWriter output, Control container); +} diff --git a/mcs/class/System.Web/System.Web.UI/TemplateControl.cs b/mcs/class/System.Web/System.Web.UI/TemplateControl.cs new file mode 100755 index 00000000000..2a878d03d45 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/TemplateControl.cs @@ -0,0 +1,115 @@ +// +// System.Web.UI.TemplateControl.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; + +namespace System.Web.UI { + + public abstract class TemplateControl : Control, INamingContainer + { + #region Constructor + protected TemplateControl () + { + } + + #endregion + + #region Properties + + [MonoTODO] + protected virtual int AutoHandlers { + get { return 1; } + set { } + } + + [MonoTODO] + protected virtual bool SupportAutoEvents { + get { return false; } + } + + #endregion + + #region Methods + + protected virtual void Construct () + { + } + + [MonoTODO] + protected virtual LiteralControl CreateResourceBasedLiteralControl ( + int offset, int size, bool fAsciiOnly) + { + return null; + } + + [MonoTODO] + protected virtual void FrameworkInitialize () + { + } + + [MonoTODO] + public Control LoadControl (string virtualPath) + { + return null; + } + + [MonoTODO] + public ITemplate LoadTemplate (string virtualPath) + { + return null; + } + + [MonoTODO] + protected virtual void OnAbortTransaction (EventArgs e) + { + } + + [MonoTODO] + protected virtual void OnCommitTransaction (EventArgs e) + { + } + + [MonoTODO] + protected virtual void OnError (EventArgs e) + { + } + + [MonoTODO] + public Control ParseControl (string content) + { + return null; + } + + [MonoTODO] + public static object ReadStringResource (Type t) + { + return null; + } + + [MonoTODO] + protected void SetStringresourcePointer (object stringResourcePointer, + int maxResourceOffset) + { + } + + [MonoTODO] + protected void WriteUTF8ResourceString (HtmlTextWriter output, int offset, + int size, bool fAsciiOnly) + { + } + + #endregion + + #region Events + + public event EventHandler AbortTransaction; + public event EventHandler CommitTransaction; + public event EventHandler Error; + #endregion + } +} diff --git a/mcs/class/System.Web/System.Web.UI/TemplateParser.cs b/mcs/class/System.Web/System.Web.UI/TemplateParser.cs new file mode 100755 index 00000000000..9121da5131a --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/TemplateParser.cs @@ -0,0 +1,17 @@ +// +// System.Web.UI.TemplateParser.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; + +namespace System.Web.UI { + + public abstract class TemplateParser : BaseParser + { + protected abstract Type CompileIntoType (); + } +} diff --git a/mcs/class/System.Web/System.Web.UI/Triplet.cs b/mcs/class/System.Web/System.Web.UI/Triplet.cs new file mode 100755 index 00000000000..28c8546c762 --- /dev/null +++ b/mcs/class/System.Web/System.Web.UI/Triplet.cs @@ -0,0 +1,36 @@ +// +// System.Web.UI.Triplet.cs +// +// Duncan Mak (duncan@ximian.com) +// +// (C) Ximian, Inc. +// + +using System; + +namespace System.Web.UI { + + public class Triplet + { + public object First; + public object Second; + public object Third; + + public Triplet () + { + } + + public Triplet (object x, object y) + { + First = x; + Second = y; + } + + public Triplet (object x, object y, object z) + { + First = x; + Second = y; + Third = z; + } + } +} diff --git a/mcs/class/System.Web/System.Web.build b/mcs/class/System.Web/System.Web.build index 112f6c85428..b2c6d939d0f 100644 --- a/mcs/class/System.Web/System.Web.build +++ b/mcs/class/System.Web/System.Web.build @@ -14,7 +14,10 @@ <arg value="/nowarn:0168"/> <!-- never used variable --> <arg value="/nowarn:0162"/> <!-- unreachable code --> <arg value="/unsafe"/> + <arg value="/noconfig"/> <arg value="/r:System.dll"/> + <arg value="/r:System.Drawing.dll"/> + <arg value="/r:System.Xml.dll"/> <sources> <includes name="**/*.cs"/> <excludes name="Test/**"/> |