2003-07-17 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
authorAndreas N <andreas@mono-cvs.ximian.com>
Thu, 17 Jul 2003 18:59:43 +0000 (18:59 -0000)
committerAndreas N <andreas@mono-cvs.ximian.com>
Thu, 17 Jul 2003 18:59:43 +0000 (18:59 -0000)
* IUserControlDesignerAccessor.cs: Added and implemented
* Control.cs: Missing member added, added all attributes
* Page.cs: Added attributes, fixed signature
* TemplateControl.cs: Fixed signature, added all attributes
* UserControl.cs: Added all attributes, added and implemented missing interface

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

mcs/class/System.Web/System.Web.UI/ChangeLog
mcs/class/System.Web/System.Web.UI/Control.cs
mcs/class/System.Web/System.Web.UI/IUserControlDesignAccessor.cs [new file with mode: 0644]
mcs/class/System.Web/System.Web.UI/Page.cs
mcs/class/System.Web/System.Web.UI/TemplateControl.cs
mcs/class/System.Web/System.Web.UI/UserControl.cs

index cb606500cd47f48cc1366831e66ebf34f6250a56..03dec3d284849f82397331451a76516a74349727 100644 (file)
@@ -1,3 +1,11 @@
+2003-07-17  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
+
+       * IUserControlDesignerAccessor.cs: Added and implemented
+       * Control.cs: Missing member added, added all attributes
+       * Page.cs: Added attributes, fixed signature
+       * TemplateControl.cs: Fixed signature, added all attributes
+       * UserControl.cs: Added all attributes, added and implemented missing interface
+       
 2003-07-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * ControlCollection.cs: fixed bug #46472.
index acc0c0527fbbbd58a8cd715143edaea142f19198..1fb54707b6b7b7cbfa863f3a8445edea964a0026 100644 (file)
@@ -2,8 +2,9 @@
 // System.Web.UI.Control.cs\r
 //\r
 // Authors:\r
-//     Bob Smith <bob@thestuff.net>\r
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)\r
+//   Bob Smith <bob@thestuff.net>\r
+//   Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)\r
 //\r
 // (C) Bob Smith\r
 // (c) 2002 Ximian, Inc. (http://www.ximian.com)\r
 \r
 using System;\r
 using System.Collections;\r
-using System.ComponentModel;\r
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.ComponentModel.Design.Serialization;\r
 using System.Web;\r
 using System.Web.Util;\r
 \r
 namespace System.Web.UI\r
-{\r
+{
+       [DefaultProperty ("ID"), DesignerCategory ("Code"), ToolboxItemFilter ("System.Web.UI", ToolboxItemFilterType.Require)]
+       [ToolboxItem ("System.Web.UI.Design.WebControlToolboxItem, " + Consts.AssemblySystem_Design)]
+       [Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
+       [DesignerSerializer ("Microsoft.VSDesigner.WebForms.ControlCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design)]\r
         public class Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor\r
         {\r
                 private static readonly object DataBindingEvent = new object();\r
@@ -129,7 +136,9 @@ namespace System.Web.UI
                 {\r
                         if (this is INamingContainer) _isNamingContainer = true;\r
                 }\r
-\r
+
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [EditorBrowsable (EditorBrowsableState.Never), Browsable (false)]\r
                public Control BindingContainer\r
                {\r
                        get {\r
@@ -139,7 +148,10 @@ namespace System.Web.UI
                                return container;\r
                        }\r
                }\r
-               \r
+               
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [WebSysDescription ("An Identification of the control that is rendered.")]\r
                public virtual string ClientID {\r
                        get {\r
                                string client = UniqueID;\r
@@ -150,7 +162,10 @@ namespace System.Web.UI
                                return client;\r
                        }\r
                }\r
-\r
+
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [WebSysDescription ("The child controls of this control.")]\r
                 public virtual ControlCollection Controls //DIT\r
                 {\r
                         get\r
@@ -158,7 +173,10 @@ namespace System.Web.UI
                                 if (_controls == null) _controls = CreateControlCollection();\r
                                 return _controls;\r
                         }\r
-                }\r
+                }
+
+               [DefaultValue (true), WebCategory ("FIXME")]
+               [WebSysDescription ("An Identification of the control that is rendered.")]\r
                 public virtual bool EnableViewState //DIT\r
                 {\r
                         get\r
@@ -170,7 +188,9 @@ namespace System.Web.UI
                                 _enableViewState = value;\r
                         }\r
                 }\r
-               \r
+               
+               [MergableProperty (false), ParenthesizePropertyName (true)]
+               [WebSysDescription ("The name of the control that is rendered.")]\r
                 public virtual string ID {\r
                         get {\r
                                 return _userId;\r
@@ -184,7 +204,10 @@ namespace System.Web.UI
                                NullifyUniqueID ();\r
                         }\r
                 }\r
-               \r
+               
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [WebSysDescription ("The container that this control is part of. The control's name has to be unique within the container.")]\r
                 public virtual Control NamingContainer //DIT\r
                 {\r
                         get\r
@@ -198,7 +221,11 @@ namespace System.Web.UI
                                 }\r
                                 return _namingContainer;\r
                         }\r
-                }\r
+                }
+
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [WebSysDescription ("The webpage that this control resides on.")]\r
                 public virtual Page Page //DIT\r
                 {\r
                         get\r
@@ -210,14 +237,22 @@ namespace System.Web.UI
                         {\r
                                 _page = value;\r
                         }\r
-                }\r
+                }
+
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [WebSysDescription ("The parent control of this control.")]\r
                 public virtual Control Parent //DIT\r
                 {\r
                         get\r
                         {\r
                                 return _parent;\r
                         }\r
-                }\r
+                }
+
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [EditorBrowsable (EditorBrowsableState.Advanced), Browsable (false)]
+               [WebSysDescription ("The site this control is part of.")]\r
                 public ISite Site //DIT\r
                 {\r
                         get\r
@@ -229,11 +264,17 @@ namespace System.Web.UI
                                 _site = value;\r
                         }\r
                 }\r
-\r
+
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [WebSysDescription ("A virtual directory containing the parent of the control.")]\r
                 public virtual string TemplateSourceDirectory {\r
                         get { return (_parent == null) ? String.Empty : _parent.TemplateSourceDirectory; }\r
                 }\r
-\r
+
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
+               [WebSysDescription ("The unique ID of the control.")]\r
                 public virtual string UniqueID {\r
                         get {\r
                                if (uniqueID != null)\r
@@ -255,7 +296,10 @@ namespace System.Web.UI
                                uniqueID = prefix + ":" + _userId;\r
                                return uniqueID;\r
                         }\r
-                }\r
+                }
+
+               [DefaultValue (true), Bindable (true), WebCategory ("FIXME")]
+               [WebSysDescription ("Visiblity state of the control.")]\r
                 public virtual bool Visible\r
                 {\r
                         get\r
@@ -437,7 +481,16 @@ namespace System.Web.UI
                                 ChildControlsCreated = true;\r
                                creatingControls = false;\r
                         }\r
-                }\r
+                }
+
+               protected bool IsLiteralContent()
+               {
+                       if (_controls != null) 
+                               if (_controls.Count == 1)
+                                       if (_controls[0] is LiteralControl)
+                                               return true;
+                       return false;
+               }\r
 \r
                 public virtual Control FindControl (string id)\r
                 {\r
@@ -597,11 +650,13 @@ namespace System.Web.UI
                         }\r
                 }\r
 \r
-               public bool HasChildren\r
+               internal bool HasChildren\r
                {\r
                        get { return (_controls != null && _controls.Count > 0); }\r
                }\r
-\r
+
+               [WebCategory ("FIXME")]
+               [WebSysDescription ("Raised when the contols databound properties are evaluated.")]\r
                 public event EventHandler DataBinding //DIT\r
                 {\r
                         add\r
@@ -612,7 +667,9 @@ namespace System.Web.UI
                         {\r
                                 Events.RemoveHandler(DataBindingEvent, value);\r
                         }\r
-                }\r
+                }
+
+               [WebSysDescription ("Raised when the contol is disposed.")]\r
                 public event EventHandler Disposed //DIT\r
                 {\r
                         add\r
@@ -623,7 +680,9 @@ namespace System.Web.UI
                         {\r
                                 Events.RemoveHandler(DisposedEvent, value);\r
                         }\r
-                }\r
+                }
+
+               [WebSysDescription ("Raised when the page containing the control is initialized.")]\r
                 public event EventHandler Init //DIT\r
                 {\r
                         add\r
@@ -634,7 +693,9 @@ namespace System.Web.UI
                         {\r
                                 Events.RemoveHandler(InitEvent, value);\r
                         }\r
-                }\r
+                }
+
+               [WebSysDescription ("Raised after the page containing the control has been loaded.")]\r
                 public event EventHandler Load //DIT\r
                 {\r
                         add\r
@@ -645,7 +706,9 @@ namespace System.Web.UI
                         {\r
                                 Events.RemoveHandler(LoadEvent, value);\r
                         }\r
-                }\r
+                }
+
+               [WebSysDescription ("Raised before the page containing the control is rendered.")]\r
                 public event EventHandler PreRender //DIT\r
                 {\r
                         add\r
@@ -656,7 +719,9 @@ namespace System.Web.UI
                         {\r
                                 Events.RemoveHandler(PreRenderEvent, value);\r
                         }\r
-                }\r
+                }
+
+               [WebSysDescription ("Raised when the page containing the control is unloaded.")]\r
                 public event EventHandler Unload //DIT\r
                 {\r
                         add\r
@@ -707,7 +772,8 @@ namespace System.Web.UI
                        HttpResponse resp = Context.Response;\r
                        return resp.ApplyAppPathModifier (UrlUtils.Combine (ts, relativeUrl));\r
                 }\r
-\r
+
+               [EditorBrowsable (EditorBrowsableState.Advanced)]\r
                 public void SetRenderMethodDelegate(RenderMethod renderMethod) //DIT\r
                 {\r
                        WebTrace.PushContext ("Control.AddParsedSubobject ()");\r
@@ -717,7 +783,7 @@ namespace System.Web.UI
                        WebTrace.PopContext ();\r
                 }\r
 \r
-                protected void LoadRecursive()\r
+                internal void LoadRecursive()\r
                 {\r
                         OnLoad (EventArgs.Empty);\r
                         if (_controls != null) {\r
@@ -727,7 +793,7 @@ namespace System.Web.UI
                        loaded = true;\r
                 }\r
 \r
-                protected void UnloadRecursive(Boolean dispose)\r
+                internal void UnloadRecursive(Boolean dispose)\r
                 {\r
                         if (_controls != null) {\r
                                foreach (Control c in _controls)\r
@@ -739,7 +805,7 @@ namespace System.Web.UI
                                Dispose();\r
                 }\r
 \r
-                protected void PreRenderRecursiveInternal()\r
+                internal void PreRenderRecursiveInternal()\r
                 {\r
                        if (_visible) {\r
                                EnsureChildControls ();\r
@@ -753,7 +819,7 @@ namespace System.Web.UI
                        prerendered = true;\r
                 }\r
 \r
-                protected void InitRecursive(Control namingContainer)\r
+                internal void InitRecursive(Control namingContainer)\r
                 {\r
                         if (_controls != null) {\r
                                if (_isNamingContainer)\r
diff --git a/mcs/class/System.Web/System.Web.UI/IUserControlDesignAccessor.cs b/mcs/class/System.Web/System.Web.UI/IUserControlDesignAccessor.cs
new file mode 100644 (file)
index 0000000..02a6ab4
--- /dev/null
@@ -0,0 +1,17 @@
+//
+// System.Web.UI.IUserControlDesignerAccessor.cs
+//
+// Author:
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
+//
+// (C) 2003 Andreas Nahr
+//
+
+namespace System.Web.UI
+{
+       public interface IUserControlDesignerAccessor
+        {
+                string InnerText { get; set; }
+               string TagName { get; set; }
+        }
+}
index 10b8bdb949827ac285a53c1a9588e74cd11a4b99..a4f08ed51edf4329c2c7c68b3ad7e93721867ee0 100755 (executable)
@@ -1,9 +1,10 @@
 //
-// System.Web.UI.Page
+// System.Web.UI.Page.cs
 //
 // Authors:
-//     Duncan Mak  (duncan@ximian.com)
-//     Gonzalo Paniagua (gonzalo@ximian.com)
+//   Duncan Mak  (duncan@ximian.com)
+//   Gonzalo Paniagua (gonzalo@ximian.com)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
 //
 // (C) 2002,2003 Ximian, Inc. (http://www.ximian.com)
 //
@@ -11,6 +12,9 @@
 using System;
 using System.Collections;
 using System.Collections.Specialized;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.ComponentModel.Design.Serialization;
 using System.IO;
 using System.Security.Principal;
 using System.Text;
@@ -22,6 +26,11 @@ using System.Web.Util;
 namespace System.Web.UI
 {
 
+// TODO FIXME missing the IRootDesigner Attribute
+[DefaultEvent ("Load"), DesignerCategory ("ASPXCodeBehind")]
+[ToolboxItem (false)]
+[Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
+[RootDesignerSerializer ("Microsoft.VSDesigner.WebForms.RootCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design, true)]
 public class Page : TemplateControl, IHttpHandler
 {
        private string _culture;
@@ -64,27 +73,36 @@ public class Page : TemplateControl, IHttpHandler
 
        #region Properties
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public HttpApplicationState Application
        {
                get { return _context.Application; }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected bool AspCompatMode
        {
                set { throw new NotImplementedException (); }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected bool Buffer
        {
                set { Response.BufferOutput = value; }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public Cache Cache
        {
                get { return _context.Cache; }
        }
 
        [MonoTODO]
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false), DefaultValue ("")]
+       [WebSysDescription ("Value do override the automatic browser detection and force the page to use the specified browser.")]
        public string ClientTarget
        {
                get { throw new NotImplementedException (); }
@@ -92,12 +110,14 @@ public class Page : TemplateControl, IHttpHandler
        }
 
        [MonoTODO]
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected int CodePage
        {
                set { throw new NotImplementedException (); }
        }
 
        [MonoTODO]
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected string ContentType
        {
                set { throw new NotImplementedException (); }
@@ -108,29 +128,36 @@ public class Page : TemplateControl, IHttpHandler
                get { return _context; }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected string Culture
        {
                set { _culture = value; }
        }
 
+       [Browsable (false)]
        public override bool EnableViewState
        {
                get { return _viewState; }
                set { _viewState = value; }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected bool EnableViewStateMac
        {
                get { return _viewStateMac; }
                set { _viewStateMac = value; }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false), DefaultValue ("")]
+       [WebSysDescription ("The URL of a page used for error redirection.")]
        public string ErrorPage
        {
                get { return _errorPage; }
                set { _errorPage = value; }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected ArrayList FileDependencies
        {
                set {
@@ -139,12 +166,15 @@ public class Page : TemplateControl, IHttpHandler
                }
        }
 
+       [Browsable (false)]
        public override string ID
        {
                get { return _ID; }
                set { _ID = value; }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public bool IsPostBack
        {
                get {
@@ -152,35 +182,46 @@ public class Page : TemplateControl, IHttpHandler
                }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never), Browsable (false)]
        public bool IsReusable {
                get { return false; }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public bool IsValid
        {
                get { return _isValid; }
        }
 
        [MonoTODO]
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected int LCID {
                set { throw new NotImplementedException (); }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public HttpRequest Request
        {
                get { return _context.Request; }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public HttpResponse Response
        {
                get { return _context.Response; }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected string ResponseEncoding
        {
                set { Response.ContentEncoding = Encoding.GetEncoding (value); }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public HttpServerUtility Server
        {
                get {
@@ -188,47 +229,60 @@ public class Page : TemplateControl, IHttpHandler
                }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public virtual HttpSessionState Session
        {
                get { return _context.Session; }
        }
 
+       [Browsable (false)]
        public bool SmartNavigation
        {
                get { return _smartNavigation; }
                set { _smartNavigation = value; }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public TraceContext Trace
        {
                get { return _trace; }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected bool TraceEnabled
        {
                set { _traceEnabled = value; }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected TraceMode TraceModeValue
        {
                set { _traceModeValue = value; }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected int TransactionMode
        {
                set { _transactionMode = value; }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected string UICulture
        {
                set { _UICulture = value; }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public IPrincipal User
        {
                get { return _context.User; }
        }
 
+       [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+       [Browsable (false)]
        public ValidatorCollection Validators
        {
                get { 
@@ -238,6 +292,7 @@ public class Page : TemplateControl, IHttpHandler
                }
        }
 
+       [Browsable (false)]
        public override bool Visible
        {
                get { return base.Visible; }
@@ -249,6 +304,7 @@ public class Page : TemplateControl, IHttpHandler
        #region Methods
 
        [MonoTODO]
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected IAsyncResult AspCompatBeginProcessRequest (HttpContext context,
                                                             AsyncCallback cb, 
                                                             object extraData)
@@ -257,22 +313,26 @@ public class Page : TemplateControl, IHttpHandler
        }
 
        [MonoTODO]
-       protected void AspcompatEndProcessRequest (IAsyncResult result)
+       [EditorBrowsable (EditorBrowsableState.Never)]
+       protected void AspCompatEndProcessRequest (IAsyncResult result)
        {
                throw new NotImplementedException ();
        }
        
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        protected virtual HtmlTextWriter CreateHtmlTextWriter (TextWriter tw)
        {
                return new HtmlTextWriter (tw);
        }
 
        [MonoTODO]
+       [EditorBrowsable (EditorBrowsableState.Never)]
        public void DesignerInitialize ()
        {
                throw new NotImplementedException ();
        }
 
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        protected virtual NameValueCollection DeterminePostBackMode ()
        {
                if (_context == null)
@@ -295,21 +355,25 @@ public class Page : TemplateControl, IHttpHandler
                return coll;
        }
        
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public string GetPostBackClientEvent (Control control, string argument)
        {
                return GetPostBackEventReference (control, argument);
        }
 
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public string GetPostBackClientHyperlink (Control control, string argument)
        {
                return "javascript:" + GetPostBackEventReference (control, argument);
        }
 
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public string GetPostBackEventReference (Control control)
        {
                return GetPostBackEventReference (control, "");
        }
-       
+
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public string GetPostBackEventReference (Control control, string argument)
        {
                RequiresPostBackScript ();
@@ -321,12 +385,14 @@ public class Page : TemplateControl, IHttpHandler
                requiresPostBackScript = true;
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        public virtual int GetTypeHashCode ()
        {
                return 0;
        }
 
        [MonoTODO]
+       [EditorBrowsable (EditorBrowsableState.Never)]
        protected virtual void InitOutputCache (int duration,
                                                string varyByHeader,
                                                string varyByCustom,
@@ -335,7 +401,8 @@ public class Page : TemplateControl, IHttpHandler
        {
                throw new NotImplementedException ();
        }
-       
+
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public bool IsClientScriptBlockRegistered (string key)
        {
                if (clientScriptBlocks == null)
@@ -343,7 +410,8 @@ public class Page : TemplateControl, IHttpHandler
 
                return clientScriptBlocks.ContainsKey (key);
        }
-       
+
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public bool IsStartupScriptRegistered (string key)
        {
                if (startupScriptBlocks == null)
@@ -480,6 +548,7 @@ public class Page : TemplateControl, IHttpHandler
                }
        }
 
+       [EditorBrowsable (EditorBrowsableState.Never)]
        public void ProcessRequest (HttpContext context)
        {
                _context = context;
@@ -520,7 +589,7 @@ public class Page : TemplateControl, IHttpHandler
                WebTrace.WriteLine ("End");
                WebTrace.PopContext ();
        }
-
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        internal void RaisePostBackEvents ()
        {
                if (requiresRaiseEvent != null) {
@@ -561,11 +630,13 @@ public class Page : TemplateControl, IHttpHandler
        }
        
        [MonoTODO]
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public void RegisterArrayDeclaration (string arrayName, string arrayValue)
        {
                throw new NotImplementedException ();
        }
-       
+
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public virtual void RegisterClientScriptBlock (string key, string script)
        {
                if (IsClientScriptBlockRegistered (key))
@@ -576,7 +647,8 @@ public class Page : TemplateControl, IHttpHandler
 
                clientScriptBlocks.Add (key, script);
        }
-       
+
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public virtual void RegisterHiddenField (string hiddenFieldName, string hiddenFieldInitialValue)
        {
                if (hiddenFields == null)
@@ -593,11 +665,13 @@ public class Page : TemplateControl, IHttpHandler
        }
 
        [MonoTODO]
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public void RegisterOnSubmitStatement (string key, string script)
        {
                throw new NotImplementedException ();
        }
-       
+
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public void RegisterRequiresPostBack (Control control)
        {
                if (_requiresPostBack == null)
@@ -606,11 +680,13 @@ public class Page : TemplateControl, IHttpHandler
                _requiresPostBack.Add (control.ID);
        }
 
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public virtual void RegisterRequiresRaiseEvent (IPostBackEventHandler control)
        {
                requiresRaiseEvent = control;
        }
 
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public virtual void RegisterStartupScript (string key, string script)
        {
                if (IsStartupScriptRegistered (key))
@@ -622,6 +698,7 @@ public class Page : TemplateControl, IHttpHandler
                startupScriptBlocks.Add (key, script);
        }
 
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public void RegisterViewStateHandler ()
        {
                handleViewState = true;
@@ -631,7 +708,8 @@ public class Page : TemplateControl, IHttpHandler
        {
                _savedViewState = viewState;
        }
-       
+
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        protected virtual object LoadPageStateFromPersistenceMedium ()
        {
                NameValueCollection postdata = DeterminePostBackMode ();
@@ -694,6 +772,7 @@ public class Page : TemplateControl, IHttpHandler
                        _isValid = true;
        }
 
+       [EditorBrowsable (EditorBrowsableState.Advanced)]
        public virtual void VerifyRenderingInServerForm (Control control)
        {
                if (!renderingForm)
index cbe94932568dd2b09072bf6cde20bec74260adc6..f1d94e305dde0dfe488c535aa3f835a859b8cd61 100755 (executable)
@@ -2,14 +2,16 @@
 // System.Web.UI.TemplateControl.cs
 //
 // Authors:
-//     Duncan Mak  (duncan@ximian.com)
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//   Duncan Mak  (duncan@ximian.com)
+//   Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
 //
 // (C) 2002 Ximian, Inc. (http://www.ximian.com)
 //
 
 using System;
 using System.Collections;
+using System.ComponentModel;
 using System.Reflection;
 using System.Web.Compilation;
 using System.Web.Util;
@@ -60,7 +62,7 @@ namespace System.Web.UI {
                }
 
                [MonoTODO]
-               protected virtual LiteralControl CreateResourceBasedLiteralControl (int offset,
+               protected LiteralControl CreateResourceBasedLiteralControl (int offset,
                                                                                    int size,
                                                                                    bool fAsciiOnly)
                {
@@ -101,6 +103,7 @@ namespace System.Web.UI {
                        }
                }
 
+               [EditorBrowsable (EditorBrowsableState.Never)]
                protected virtual void FrameworkInitialize ()
                {
                }
@@ -156,18 +159,21 @@ namespace System.Web.UI {
                }
 
                [MonoTODO]
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public static object ReadStringResource (Type t)
                {
                        return null;
                }
 
                [MonoTODO]
+               [EditorBrowsable (EditorBrowsableState.Never)]
                protected void SetStringResourcePointer (object stringResourcePointer,
                                                         int maxResourceOffset)
                {
                }
 
                [MonoTODO]
+               [EditorBrowsable (EditorBrowsableState.Never)]
                protected void WriteUTF8ResourceString (HtmlTextWriter output, int offset,
                                                        int size, bool fAsciiOnly)
                {
@@ -177,16 +183,19 @@ namespace System.Web.UI {
 
                #region Events
 
+               [WebSysDescription ("Raised when the user aborts a transaction.")]
                public event EventHandler AbortTransaction {
                        add { Events.AddHandler (abortTransaction, value); }
                        remove { Events.RemoveHandler (abortTransaction, value); }
                }
 
+               [WebSysDescription ("Raised when the user initiates a transaction.")]
                public event EventHandler CommitTransaction {
                        add { Events.AddHandler (commitTransaction, value); }
                        remove { Events.RemoveHandler (commitTransaction, value); }
                }
 
+               [WebSysDescription ("Raised when an exception occurs that cannot be handled.")]
                public event EventHandler Error {
                        add { Events.AddHandler (error, value); }
                        remove { Events.RemoveHandler (error, value); }
index e7b6194bfdf87774329b2402bdf4b3951c151f90..b09fe314506005a368a6eb3dc24aa09325698488 100644 (file)
@@ -1,19 +1,27 @@
 //
-// System.Web.UI.UserControl
+// System.Web.UI.UserControl.cs
 //
 // Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//   Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
 //
 // (C) 2002 Ximian, Inc (http://www.ximian.com)
 //
 using System;
+using System.ComponentModel;
+using System.ComponentModel.Design;
+using System.ComponentModel.Design.Serialization;
 using System.Web.Caching;
 using System.Web.SessionState;
 
 namespace System.Web.UI
 {
        [ControlBuilder (typeof (UserControlControlBuilder))]
-       public class UserControl : TemplateControl, IAttributeAccessor
+       [DefaultEvent ("Load"), DesignerCategory ("ASPXCodeBehind")]
+       [ToolboxItem (false)]
+       [Designer ("System.Web.UI.Design.UserControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
+       [RootDesignerSerializer ("Microsoft.VSDesigner.WebForms.RootCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design, true)]
+       public class UserControl : TemplateControl, IAttributeAccessor, IUserControlDesignerAccessor
        {
                private bool initialized;
                private AttributeCollection attributes;
@@ -24,6 +32,8 @@ namespace System.Web.UI
                        //??
                }
 
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
                public HttpApplicationState Application
                {
                        get {
@@ -44,6 +54,8 @@ namespace System.Web.UI
                        }
                }
 
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
                public AttributeCollection Attributes
                {
                        get {
@@ -51,6 +63,8 @@ namespace System.Web.UI
                        }
                }
 
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
                public Cache Cache
                {
                        get {
@@ -61,6 +75,8 @@ namespace System.Web.UI
                        }
                }
 
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
                public bool IsPostBack
                {
                        get {
@@ -71,6 +87,8 @@ namespace System.Web.UI
                        }
                }
 
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
                public HttpRequest Request
                {
                        get {
@@ -81,6 +99,8 @@ namespace System.Web.UI
                        }
                }
 
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
                public HttpResponse Response
                {
                        get {
@@ -91,6 +111,8 @@ namespace System.Web.UI
                        }
                }
 
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
                public HttpServerUtility Server
                {
                        get {
@@ -101,6 +123,8 @@ namespace System.Web.UI
                        }
                }
 
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
                public HttpSessionState Session
                {
                        get {
@@ -111,6 +135,8 @@ namespace System.Web.UI
                        }
                }
 
+               [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+               [Browsable (false)]
                public TraceContext Trace
                {
                        get {
@@ -122,11 +148,13 @@ namespace System.Web.UI
                }
 
                [MonoTODO]
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public void DesignerInitialize ()
                {
                        throw new NotImplementedException ();
                }
 
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public void InitializeAsUserControl (Page page)
                {
                        if (initialized)
@@ -185,6 +213,28 @@ namespace System.Web.UI
                        EnsureAttributes ();
                        Attributes [name] = value;
                }
+
+               string IUserControlDesignerAccessor.InnerText
+               {
+                       get {
+                               string innerText = ((string) ViewState["!DesignTimeInnerText"]);
+                               if (innerText == null)
+                                       return string.Empty; 
+                               return innerText;
+                       }
+                       set { ViewState["!DesignTimeInnerText"] = value; }
+               }
+
+               string IUserControlDesignerAccessor.TagName
+               {
+                       get {
+                               string innerTag = ((string) ViewState["!DesignTimeTagName"]);
+                               if (innerTag == null)
+                                       return string.Empty; 
+                               return innerTag;
+                       }
+                       set { ViewState["!DesignTimeTagName"] = value; }
+               }
        }
 }