2002-05-10 Duncan Mak <duncan@ximian.com>
authorDuncan Mak <duncan@mono-cvs.ximian.com>
Fri, 10 May 2002 18:51:24 +0000 (18:51 -0000)
committerDuncan Mak <duncan@mono-cvs.ximian.com>
Fri, 10 May 2002 18:51:24 +0000 (18:51 -0000)
* ConstructorNeedsTagAttribute.cs:
* ControlBuilderAttribute.cs:
* ImageClickEventArgs.cs:
* ParseChildrenAttribute.cs:
* PartialCachingAttribute.cs:
* PersistChildrenAttribute.cs:
* PersistenceModeAttribute.cs:
* TemplateContainerAttribute.cs: Added to CVS.

* PersistanceMode.cs: Removed, fixed typo.
* PersistenceMode.cs: Replacing above.

* StateBag.cs (this): Fixed indexer, it takes a string as the
index, not an object.

svn path=/trunk/mcs/; revision=4498

12 files changed:
mcs/class/System.Web/System.Web.UI/ChangeLog
mcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs [new file with mode: 0755]
mcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs [new file with mode: 0755]
mcs/class/System.Web/System.Web.UI/ImageClickEventArgs.cs [new file with mode: 0755]
mcs/class/System.Web/System.Web.UI/ParseChildrenAttribute.cs [new file with mode: 0755]
mcs/class/System.Web/System.Web.UI/PartialCachingAttribute.cs [new file with mode: 0755]
mcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs [new file with mode: 0755]
mcs/class/System.Web/System.Web.UI/PersistanceMode.cs [deleted file]
mcs/class/System.Web/System.Web.UI/PersistenceMode.cs [new file with mode: 0755]
mcs/class/System.Web/System.Web.UI/PersistenceModeAttribute.cs [new file with mode: 0755]
mcs/class/System.Web/System.Web.UI/StateBag.cs
mcs/class/System.Web/System.Web.UI/TemplateContainerAttribute.cs [new file with mode: 0755]

index 0aa06e97cba133b11a03fac1baa16992b3fbedf7..c68617306e598668e73747abd0c3797ab33b76cb 100644 (file)
@@ -1,5 +1,20 @@
 2002-05-10  Duncan Mak  <duncan@ximian.com>
 
+       * ConstructorNeedsTagAttribute.cs: 
+       * ControlBuilderAttribute.cs: 
+       * ImageClickEventArgs.cs: 
+       * ParseChildrenAttribute.cs: 
+       * PartialCachingAttribute.cs: 
+       * PersistChildrenAttribute.cs: 
+       * PersistenceModeAttribute.cs: 
+       * TemplateContainerAttribute.cs: Added to CVS.
+
+       * PersistanceMode.cs: Removed, fixed typo.
+       * PersistenceMode.cs: Replacing above.
+
+       * StateBag.cs (this): Fixed indexer, it takes a string as the
+       index, not an object.
+
        * ValidatorCollection.cs: Fixed typo, ValidatedCollection to ValidatorCollection. 
 
        * Page.cs (Validators): return type should be ValidatorCollection,
diff --git a/mcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs b/mcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs
new file mode 100755 (executable)
index 0000000..f52a4c6
--- /dev/null
@@ -0,0 +1,32 @@
+//
+// System.Web.UI.ConstructorNeedsTagAttribute.cs
+//
+// Duncan Mak  (duncan@ximian.com)
+//
+// (C) Ximian, Inc.
+
+using System;
+
+namespace System.Web.UI {
+
+       [AttributeUsage (AttributeTargets.Class)]
+       public sealed class ConstructorNeedsTagAttribute : Attribute
+       {
+               bool needsTag;
+
+               // LAMESPEC: we will default to true for now.
+               public ConstructorNeedsTagAttribute ()
+               {
+                       needsTag = true;
+               }
+
+               public ConstructorNeedsTagAttribute (bool needsTag)
+               {
+                       this.needsTag = needsTag;
+               }
+
+               public bool NeedsTag {
+                       get { return needsTag; }
+               }
+       }
+}
diff --git a/mcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs b/mcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs
new file mode 100755 (executable)
index 0000000..b554811
--- /dev/null
@@ -0,0 +1,45 @@
+//
+// System.Web.UI.ControlBuilderAttribute.cs
+//
+// Duncan Mak  (duncan@ximian.com)
+//
+// (C) Ximian, Inc.
+
+using System;
+
+namespace System.Web.UI {
+
+       [AttributeUsage (AttributeTargets.Class)]
+       public sealed class ControlBuilderAttribute : Attribute
+       {
+               Type builderType;
+               public static readonly ControlBuilderAttribute Default;
+               
+               public ControlBuilderAttribute (Type builderType)
+               {
+                       this.builderType = builderType;
+               }
+
+               public Type BuilderType {
+                       get { return builderType; }
+               }
+
+               [MonoTODO]
+               public override bool Equals (object obj)
+               {
+                       return false;
+               }
+
+               [MonoTODO]
+               public override int GetHashCode ()
+               {
+                       return 42;
+               }
+
+               [MonoTODO]
+               public override bool IsDefaultAttribute ()
+               {
+                       return false;
+               }
+       }
+}
diff --git a/mcs/class/System.Web/System.Web.UI/ImageClickEventArgs.cs b/mcs/class/System.Web/System.Web.UI/ImageClickEventArgs.cs
new file mode 100755 (executable)
index 0000000..d2330bb
--- /dev/null
@@ -0,0 +1,25 @@
+//
+// System.Web.UI.ImageClickEventArgs.cs
+//
+// Duncan Mak  (duncan@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+using System;
+
+namespace System.Web.UI {
+       public sealed class ImageClickEventArgs : EventArgs
+       {
+               public ImageClickEventArgs (int x, int y)
+               {
+                       X = x;
+                       Y = y;
+               }
+               
+               public int X;
+               public int Y;
+       }
+}
+
diff --git a/mcs/class/System.Web/System.Web.UI/ParseChildrenAttribute.cs b/mcs/class/System.Web/System.Web.UI/ParseChildrenAttribute.cs
new file mode 100755 (executable)
index 0000000..4a41b4f
--- /dev/null
@@ -0,0 +1,72 @@
+//
+// System.Web.UI.ParseChildrenAttribute.cs
+//
+// Duncan Mak  (duncan@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+using System;
+
+namespace System.Web.UI {
+
+       [AttributeUsage (AttributeTargets.Class)]
+       public sealed class ParseChildrenAttribute : Attribute
+       {
+               bool childrenAsProperties;
+               string defaultProperty;
+
+               // LAMESPEC
+               public ParseChildrenAttribute ()
+               {
+                       childrenAsProperties = false;
+                       defaultProperty = "";
+               }
+
+               public ParseChildrenAttribute (bool childrenAsProperties)
+               {
+                       this.childrenAsProperties = childrenAsProperties;
+                       this.defaultProperty = "";
+               }
+
+               public ParseChildrenAttribute (bool childrenAsProperties,
+                                              string defaultProperty)
+               {
+                       this.childrenAsProperties = childrenAsProperties;
+                       this.defaultProperty = defaultProperty;
+               }
+
+               public static readonly ParseChildrenAttribute Default;
+
+               public bool ChildrenAsProperties {
+
+                       get { return childrenAsProperties; }
+
+                       set { childrenAsProperties = value; }
+               }
+
+               public string DefaultProperty {
+                       get { return defaultProperty; }
+
+                       set { defaultProperty = value; }
+               }
+
+               [MonoTODO]
+               public override bool Equals (object obj)
+               {
+                       return false;
+               }
+
+               [MonoTODO]
+               public override int GetHashCode ()
+               {
+                       return 42;
+               }
+
+               [MonoTODO]
+               public override bool IsDefaultAttribute ()
+               {
+                       return false;
+               }
+       }
+}
diff --git a/mcs/class/System.Web/System.Web.UI/PartialCachingAttribute.cs b/mcs/class/System.Web/System.Web.UI/PartialCachingAttribute.cs
new file mode 100755 (executable)
index 0000000..be49031
--- /dev/null
@@ -0,0 +1,51 @@
+//
+// System.Web.UI.PartialCachingAttribute.cs
+//
+// Duncan Mak  (duncan@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+using System;
+
+namespace System.Web.UI {
+
+       [AttributeUsage (AttributeTargets.Class)]
+       public sealed class PartialCachingAttribute : Attribute
+       {
+               int duration;
+               string varyByControls;
+               string varyByCustom;
+               string varyByParams;
+               
+               public PartialCachingAttribute (int duration)
+               {
+                       this.duration = duration;
+               }
+
+               public PartialCachingAttribute (int duration, string varyByParams,
+                                               string varyByControls, string varyByCustom)
+               {
+                       this.duration = duration;
+                       this.varyByParams = varyByParams;
+                       this.varyByControls = varyByControls;
+                       this.varyByCustom = varyByCustom;
+               }
+
+               public int Duration {
+                       get { return duration; }
+               }
+
+               public string VaryByParams {
+                       get { return varyByParams; }
+               }
+
+               public string VaryByControls {
+                       get { return varyByControls; }
+               }
+
+               public string VaryByCustom {
+                       get { return varyByCustom; }
+               }
+       }
+}
diff --git a/mcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs b/mcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs
new file mode 100755 (executable)
index 0000000..a38d49c
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// System.Web.UI.PersistChildrenAttribute.cs
+//
+// Duncan Mak  (duncan@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+using System;
+
+namespace System.Web.UI {
+
+       [AttributeUsage (AttributeTargets.Class)]
+       public sealed class PersistChildrenAttribute : Attribute
+       {
+               bool persist;
+               
+               public PersistChildrenAttribute (bool persist)
+               {
+                       this.persist = persist;
+               }
+
+               public static readonly PersistChildrenAttribute Default;
+               public static readonly PersistChildrenAttribute Yes;
+               public static readonly PersistChildrenAttribute No;
+
+               public bool Persist {
+                       get { return persist; }
+               }
+
+               [MonoTODO]
+               public override bool Equals (object obj)
+               {
+                       return false;
+               }
+
+               [MonoTODO]
+               public override int GetHashCode ()
+               {
+                       return 42;
+               }
+
+               [MonoTODO]
+               public override bool IsDefaultAttribute ()
+               {
+                       return false;
+               }
+       }
+}
+       
diff --git a/mcs/class/System.Web/System.Web.UI/PersistanceMode.cs b/mcs/class/System.Web/System.Web.UI/PersistanceMode.cs
deleted file mode 100644 (file)
index 4799d74..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Web.UI.PersistanceMode.cs
-//
-// Author:
-//   Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
-        public enum PersistenceMode
-        {
-                Attribute,
-                EncodedInnerDefaultProperty,
-                InnerDefaultProperty,
-                InnerProperty
-        }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/PersistenceMode.cs b/mcs/class/System.Web/System.Web.UI/PersistenceMode.cs
new file mode 100755 (executable)
index 0000000..e58f284
--- /dev/null
@@ -0,0 +1,22 @@
+//
+// System.Web.UI.PersistenceMode.cs
+//
+// Author:
+//   Bob Smith <bob@thestuff.net>
+//
+// (C) Bob Smith
+//
+
+using System;
+using System.Web;
+
+namespace System.Web.UI
+{
+        public enum PersistenceMode
+        {
+                Attribute = 0,
+               InnerProperty = 1,
+               InnerDefaultProperty = 2,
+                EncodedInnerDefaultProperty = 3,
+        }
+}
diff --git a/mcs/class/System.Web/System.Web.UI/PersistenceModeAttribute.cs b/mcs/class/System.Web/System.Web.UI/PersistenceModeAttribute.cs
new file mode 100755 (executable)
index 0000000..1f878f6
--- /dev/null
@@ -0,0 +1,52 @@
+//
+// System.Web.UI.PersistenceModeAttribute.cs
+//
+// Duncan Mak  (duncan@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+using System;
+
+namespace System.Web.UI {
+
+       [AttributeUsage (AttributeTargets.Class)]
+       public sealed class PersistenceModeAttribute : Attribute
+       {
+               PersistenceMode mode;
+               
+               public PersistenceModeAttribute (PersistenceMode mode)
+               {
+                       this.mode = mode;
+               }
+
+               public static readonly PersistenceModeAttribute Attribute;
+               public static readonly PersistenceModeAttribute Default;
+               public static readonly PersistenceModeAttribute EncodedInnerDefaultProperty;
+               public static readonly PersistenceModeAttribute InnerDefaultProperty;
+               public static readonly PersistenceModeAttribute InnerProperty;
+               
+               public PersistenceMode Mode {
+                       get { return mode; }
+               }
+
+               [MonoTODO]
+               public override bool Equals (object obj)
+               {
+                       return false;
+               }
+
+               [MonoTODO]
+               public override int GetHashCode ()
+               {
+                       return 42;
+               }
+
+               [MonoTODO]
+               public override bool IsDefaultAttribute ()
+               {
+                       return false;
+               }
+       }
+}
+       
index fecb7a1c5b2a07be916decc25b520d5c61c0be13..1d1f3ee7fc77b8931b1e0009441df00ce385e2ab 100644 (file)
@@ -48,22 +48,33 @@ namespace System.Web.UI
                                return bag.Count;\r
                        }\r
                }\r
+\r
                \r
-               public object this[object key]\r
+               public object this[string key]\r
                {\r
                        get\r
                        {\r
-                               string sKey = (string)key;\r
-                               if(sKey==null || sKey.Length==0)\r
+                               if(key==null || key.Length==0)\r
                                        throw new ArgumentException(HttpRuntime.FormatResourceString("Key_Cannot_Be_Null"));\r
-                               object val = bag[sKey];\r
+                               object val = bag[key];\r
                                if(val is StateItem)\r
                                        return val;\r
                                return null;\r
                        }\r
                        set\r
                        {\r
-                               Add((string)key, value);\r
+                               Add(key, value);\r
+                       }\r
+               }\r
+\r
+               public object this [object key]\r
+               {\r
+                       get {\r
+                               return this [(string) key] as object;\r
+                       }\r
+\r
+                       set {\r
+                               Add ((string) key, value);\r
                        }\r
                }\r
                \r
diff --git a/mcs/class/System.Web/System.Web.UI/TemplateContainerAttribute.cs b/mcs/class/System.Web/System.Web.UI/TemplateContainerAttribute.cs
new file mode 100755 (executable)
index 0000000..854bcf1
--- /dev/null
@@ -0,0 +1,27 @@
+//
+// System.Web.UI.TemplateContainerAttribute.cs
+//
+// Duncan Mak  (duncan@ximian.com)
+//
+// (C) Ximian, Inc.
+//
+
+using System;
+
+namespace System.Web.UI {
+
+       [AttributeUsage (AttributeTargets.Property)]
+       public sealed class TemplateContainerAttribute : Attribute
+       {
+               Type containerType;
+               
+               public TemplateContainerAttribute (Type containerType)
+               {
+                       this.containerType = containerType;
+               }
+
+               public Type ContainerType {
+                       get { return containerType; }
+               }
+       }
+}