Browse Source

2002-07-12 Gonzalo Paniagua Javier <[email protected]>

	* 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
Gonzalo Paniagua Javier 23 năm trước cách đây
mục cha
commit
8f35dc38ed

+ 4 - 0
mcs/class/System.Web/ChangeLog

@@ -1,3 +1,7 @@
+2002-07-12  Gonzalo Paniagua Javier <[email protected]>
+
+	* System.Web.build: removed some more excludes.
+
 2002-07-05  Gonzalo Paniagua Javier <[email protected]>
 
 	* list: updated. Currently mcs cannot compile System.Web because it

+ 18 - 2
mcs/class/System.Web/System.Web.Hosting/AppDomainFactory.cs

@@ -3,8 +3,10 @@
 //
 // Author:
 //   Bob Smith <[email protected]>
+//   Gonzalo Paniagua ([email protected])
 //
 // (C) Bob Smith
+// (c) 2002 Ximian, Inc. (http://www.ximian.com)
 //
 
 using System;
@@ -13,7 +15,21 @@ namespace System.Web.Hosting
 {
         public sealed class AppDomainFactory : IAppDomainFactory
         {
-                public AppDomainFactory();
-                public object Create(string module, string typeName, string appId, string appPath, string strUrlOfAppOrigin, int iZone);
+		[MonoTODO]
+                public AppDomainFactory ()
+		{
+			throw new NotImplementedException ();
+		}
+		
+		[MonoTODO]
+                public object Create (string module,
+				      string typeName,
+				      string appId,
+				      string appPath,
+				      string strUrlOfAppOrigin,
+				      int iZone)
+		{
+			throw new NotImplementedException ();
+		}
         }
 }

+ 7 - 0
mcs/class/System.Web/System.Web.Hosting/ChangeLog

@@ -1,3 +1,10 @@
+2002-07-12  Gonzalo Paniagua Javier <[email protected]>
+
+	* System.Web.Hosting/AppDomainFactory.cs:
+	* System.Web.Hosting/IAppDomainFactory.cs:
+	* System.Web.Hosting/IISAPIRuntime.cs:
+	* System.Web.Hosting/ISAPIRuntime.cs: make them compile.
+
 2002-04-10  Patrik Torstensson <[email protected]>
 
         * ApplicationHost.cs: Test implementation to support testing.

+ 7 - 1
mcs/class/System.Web/System.Web.Hosting/IAppDomainFactory.cs

@@ -13,6 +13,12 @@ namespace System.Web.Hosting
 {
         public interface IAppDomainFactory
         {
-                object Create(in string module, in string typeName, in string appId, in string appPath, in string strUrlOfAppOrigin, in int iZone);
+                object Create (string module,
+			       string typeName,
+			       string appId,
+			       string appPath,
+			       string strUrlOfAppOrigin,
+			       int iZone);
         }
 }
+

+ 4 - 4
mcs/class/System.Web/System.Web.Hosting/IISAPIRuntime.cs

@@ -13,9 +13,9 @@ namespace System.Web.Hosting
 {
         public interface IISAPIRuntime
         {
-                void DoGCCollect();
-                int ProcessRequest(in IntPtr ecb, in int useProcessModel);
-                void StartProcessing();
-                void StopProcessing();
+                void DoGCCollect ();
+                int ProcessRequest (IntPtr ecb, int useProcessModel);
+                void StartProcessing ();
+                void StopProcessing ();
         }
 }

+ 31 - 5
mcs/class/System.Web/System.Web.Hosting/ISAPIRuntime.cs

@@ -3,8 +3,10 @@
 //
 // Author:
 //   Bob Smith <[email protected]>
+//   Gonzalo Paniagua ([email protected])
 //
 // (C) Bob Smith
+// (c) 2002 Ximian, Inc. (http://www.ximian.com)
 //
 
 using System;
@@ -13,10 +15,34 @@ namespace System.Web.Hosting
 {
         public sealed class ISAPIRuntime : IISAPIRuntime
         {
-                public ISAPIRuntime();
-                public void DoGCCollect();
-                public int ProcessRequest(IntPtr ecb, int iWRType);
-                public void StartProcessing();
-                public void StopProcessing();
+		[MonoTODO]
+                public ISAPIRuntime ()
+		{
+			throw new NotImplementedException ();
+		}
+		
+		[MonoTODO]
+                public void DoGCCollect ()
+		{
+			throw new NotImplementedException ();
+		}
+		
+		[MonoTODO]
+                public int ProcessRequest (IntPtr ecb, int iWRType)
+		{
+			throw new NotImplementedException ();
+		}
+		
+		[MonoTODO]
+                public void StartProcessing ()
+		{
+			throw new NotImplementedException ();
+		}
+		
+		[MonoTODO]
+                public void StopProcessing ()
+		{
+			throw new NotImplementedException ();
+		}
         }
 }

+ 10 - 4
mcs/class/System.Web/System.Web.UI/AttributeCollection.cs

@@ -1,9 +1,11 @@
 //
 // System.Web.UI.AttributeCollection.cs
 //
-// Duncan Mak  ([email protected])
+// Authors:
+// 	Duncan Mak  ([email protected])
+// 	Gonzalo Paniagua ([email protected])
 //
-// (C) Ximian, Inc.
+// (C) 2002 Ximian, Inc. (http://www.ximian.com
 //
 
 using System;
@@ -14,6 +16,7 @@ namespace System.Web.UI {
 	public sealed class AttributeCollection
 	{
 		private StateBag bag;
+		private CssStyleCollection styleCollection;
 		
 		public AttributeCollection (StateBag bag)
 		{
@@ -24,9 +27,12 @@ namespace System.Web.UI {
 			get { return bag.Count; }
 		}
 
-		[MonoTODO]
 		public CssStyleCollection CssStyle {
-			get { return null; }
+			get {
+				if (styleCollection == null)
+					styleCollection = new CssStyleCollection (bag);
+				return styleCollection;
+			}
 		}
 
 		public string this [string key] {

+ 21 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,24 @@
+2002-07-12  Gonzalo Paniagua Javier <[email protected]>
+
+	* 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.
+
 2002-07-08  Gonzalo Paniagua Javier <[email protected]>
 
 	* Control.cs: fixed Visible property.

+ 18 - 10
mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs

@@ -1,9 +1,11 @@
 //
 // System.Web.UI.CssStyleCollection.cs
 //
-// Duncan Mak  ([email protected])
+// Authors:
+// 	Duncan Mak  ([email protected])
+// 	Gonzalo Paniagua ([email protected])
 //
-// (C) Ximian, Inc.
+// (C) 2002 Ximian, Inc. (http://www.ximian.com)
 //
 
 using System;
@@ -13,36 +15,42 @@ namespace System.Web.UI {
 
 	public sealed class CssStyleCollection
 	{
-		Hashtable list = new Hashtable ();
+		private StateBag bag;
 
+		internal CssStyleCollection (StateBag bag)
+		{
+			this.bag = bag;
+		}
+		
 		public int Count {
-			get { return list.Count; }
+			get { return bag.Count; }
 		}
 
 		public string this [string key] {
 
-			get { return list [key] as string; }
+			get { return bag [key] as string; }
 
-			set { list [key] = value; }
+			set { bag [key] = value; }
 		}
 
 		public ICollection Keys {
-			get { return list.Keys; }
+			get { return bag.Keys; }
 		}
 
 		public void Add (string key, string value)
 		{
-			list.Add (key, value);
+			bag.Add (key, value);
 		}
 
 		public void Clear ()
 		{
-			list.Clear ();
+			bag.Clear ();
 		}
 
 		public void Remove (string key)
 		{
-			list.Remove (key);
+			bag.Remove (key);
 		}
 	}
 }
+

+ 17 - 9
mcs/class/System.Web/System.Web.UI/DataBinding.cs

@@ -1,9 +1,11 @@
 //
 // System.Web.UI.DataBinding.cs
 //
-// Duncan Mak  ([email protected])
+// Authors:
+// 	Duncan Mak  ([email protected])
+// 	Gonzalo Paniagua Javier ([email protected])
 //
-// (C) Ximian, Inc.
+// (C) 2002 Ximian, Inc. (http://www.ximian.com)
 //
 
 using System;
@@ -13,10 +15,10 @@ namespace System.Web.UI {
 	public sealed class DataBinding
 	{
 		string propertyName;
-		string propertyType;
+		Type propertyType;
 		string expression;
 
-		public DataBinding (string propertyName, string propertyType,
+		public DataBinding (string propertyName, Type propertyType,
 				    string expression)
 		{
 			this.propertyName = propertyName;
@@ -26,27 +28,33 @@ namespace System.Web.UI {
 
 		public string Expression {
 			get { return expression; }
+			set { expression = value; }
 		}
 
 		public string PropertyName {
 			get { return propertyName; }
 		}
 
-		public string PropertyType {
+		public Type PropertyType {
 			get { return propertyType; }
 		}
 
 		public override bool Equals (object obj)
 		{
-			if (((DataBinding) obj).PropertyName == this.PropertyName)
-				return true;
-			else
+			if (!(obj is DataBinding))
 				return false;
+			
+			DataBinding o = (DataBinding) obj;
+			return (o.Expression == expression &&
+				o.PropertyName == propertyName &&
+				o.PropertyType == propertyType);
 		}
 
 		public override int GetHashCode ()
 		{
-			return propertyName.GetHashCode ();
+			return propertyName.GetHashCode () +
+			       (propertyType.GetHashCode () << 1) +
+			       (expression.GetHashCode () << 2) ;
 		}
 	}
 }

+ 5 - 4
mcs/class/System.Web/System.Web.UI/DataBoundLiteralControl.cs

@@ -48,10 +48,10 @@ namespace System.Web.UI {
 			return new EmptyControlCollection (this);
 		}
 
-		[MonoTODO]
 		protected override void LoadViewState (object savedState)
 		{
-			throw new NotImplementedException ();
+			if (savedState != null)
+				dataBoundLiterals = (string []) savedState;
 		}
 
 		protected override void Render (HtmlTextWriter output)
@@ -59,10 +59,11 @@ namespace System.Web.UI {
 			output.Write (Text);
 		}
 
-		[MonoTODO]
 		protected override object SaveViewState ()
 		{
-			throw new NotImplementedException ();
+			if (dataBoundLiterals.Length == 0)
+				return null;
+			return dataBoundLiterals;
 		}
 
 		public void SetDataBoundString (int index, string s)

+ 1 - 1
mcs/class/System.Web/System.Web.UI/Page.cs

@@ -129,7 +129,7 @@ public class Page : TemplateControl, IHttpHandler
 		set { _errorPage = value; }
 	}
 
-	public ArrayList FileDependencies
+	ArrayList FileDependencies
 	{
 		set { _fileDependencies = value; }
 	}

+ 18 - 10
mcs/class/System.Web/System.Web.UI/ParseChildrenAttribute.cs

@@ -1,9 +1,11 @@
 //
 // System.Web.UI.ParseChildrenAttribute.cs
 //
-// Duncan Mak  ([email protected])
+// Authors:
+// 	Duncan Mak  ([email protected])
+// 	Gonzalo Paniagua ([email protected])
 //
-// (C) Ximian, Inc.
+// (C) 2002 Ximian, Inc. (http://www.ximian.com
 //
 
 using System;
@@ -15,6 +17,7 @@ namespace System.Web.UI {
 	{
 		bool childrenAsProperties;
 		string defaultProperty;
+		public static readonly ParseChildrenAttribute Default = new ParseChildrenAttribute ();
 
 		// LAMESPEC
 		public ParseChildrenAttribute ()
@@ -33,11 +36,10 @@ namespace System.Web.UI {
 					       string defaultProperty)
 		{
 			this.childrenAsProperties = childrenAsProperties;
-			this.defaultProperty = defaultProperty;
+			if (childrenAsProperties)
+				this.defaultProperty = defaultProperty;
 		}
 
-		public static readonly ParseChildrenAttribute Default;
-
 		public bool ChildrenAsProperties {
 
 			get { return childrenAsProperties; }
@@ -51,22 +53,28 @@ namespace System.Web.UI {
 			set { defaultProperty = value; }
 		}
 
-		[MonoTODO]
 		public override bool Equals (object obj)
 		{
+			if (!(obj is ParseChildrenAttribute))
+				return false;
+
+			ParseChildrenAttribute o = (ParseChildrenAttribute) obj;
+			if (childrenAsProperties == o.childrenAsProperties){
+				if (childrenAsProperties == false)
+					return true;
+				return (defaultProperty == o.DefaultProperty);
+			}
 			return false;
 		}
 
-		[MonoTODO]
 		public override int GetHashCode ()
 		{
-			return 42;
+			return base.GetHashCode ();
 		}
 
-		[MonoTODO]
 		public override bool IsDefaultAttribute ()
 		{
-			return false;
+			return Equals (Default);
 		}
 	}
 }

+ 4 - 6
mcs/class/System.Web/System.Web.build

@@ -24,12 +24,10 @@
 			<sources>
 				<includes name="**/*.cs"/> 
 				<excludes name="Test/**"/>
-				<includes name="System.Web.Hosting/ApplicationHost.cs"/> 
-				<includes name="System.Web.Hosting/SimpleWorkerRequest.cs.cs"/> 
-				<excludes name="System.Web.Hosting/ISAPIRuntime.cs"/>
-				<excludes name="System.Web.Hosting/IISAPIRuntime.cs"/>
-				<excludes name="System.Web.Hosting/IAppDomainFactory.cs"/>
-				<excludes name="System.Web.Hosting/AppDomainFactory.cs"/>
+				<!--<excludes name="System.Web.Hosting/ISAPIRuntime.cs"/>-->
+				<!--<excludes name="System.Web.Hosting/IISAPIRuntime.cs"/>-->
+				<!--<excludes name="System.Web.Hosting/IAppDomainFactory.cs"/>-->
+				<!--<excludes name="System.Web.Hosting/AppDomainFactory.cs"/>-->
 				<!--<excludes name="System.Web.UI/**"/>-->
 				<!--<excludes name="System.Web.UI.HtmlControls/**"/>-->
 				<!--<excludes name="System.Web.UI.WebControls/**"/>-->