- 1.1 code removal
authorMarek Habersack <grendel@twistedcode.net>
Mon, 21 Jun 2010 21:01:26 +0000 (21:01 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Mon, 21 Jun 2010 21:01:26 +0000 (21:01 -0000)
- coding style
- minor optimizations

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

53 files changed:
mcs/class/System.Web/System.Web.UI.WebControls/AccessDataSource.cs
mcs/class/System.Web/System.Web.UI.WebControls/AccessDataSourceView.cs
mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventArgs.cs
mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs
mcs/class/System.Web/System.Web.UI.WebControls/AssociatedControlConverter.cs
mcs/class/System.Web/System.Web.UI.WebControls/AuthenticateEventArgs.cs
mcs/class/System.Web/System.Web.UI.WebControls/AuthenticateEventHandler.cs
mcs/class/System.Web/System.Web.UI.WebControls/AutoCompleteType.cs
mcs/class/System.Web/System.Web.UI.WebControls/AutoGeneratedField.cs
mcs/class/System.Web/System.Web.UI.WebControls/AutoGeneratedFieldProperties.cs
mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
mcs/class/System.Web/System.Web.UI.WebControls/BaseDataBoundControl.cs
mcs/class/System.Web/System.Web.UI.WebControls/BaseDataList.cs
mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs
mcs/class/System.Web/System.Web.UI.WebControls/BoundField.cs
mcs/class/System.Web/System.Web.UI.WebControls/BulletStyle.cs
mcs/class/System.Web/System.Web.UI.WebControls/BulletedList.cs
mcs/class/System.Web/System.Web.UI.WebControls/Button.cs
mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumn.cs
mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs
mcs/class/System.Web/System.Web.UI.WebControls/ButtonField.cs
mcs/class/System.Web/System.Web.UI.WebControls/ButtonFieldBase.cs
mcs/class/System.Web/System.Web.UI.WebControls/ButtonType.cs
mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs
mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs
mcs/class/System.Web/System.Web.UI.WebControls/ChangePassword.cs
mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxField.cs
mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs
mcs/class/System.Web/System.Web.UI.WebControls/ChildTable.cs
mcs/class/System.Web/System.Web.UI.WebControls/CircleHotSpot.cs
mcs/class/System.Web/System.Web.UI.WebControls/CollectionDataSource.cs
mcs/class/System.Web/System.Web.UI.WebControls/CommandField.cs
mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs
mcs/class/System.Web/System.Web.UI.WebControls/CompleteWizardStep.cs
mcs/class/System.Web/System.Web.UI.WebControls/CompositeControl.cs
mcs/class/System.Web/System.Web.UI.WebControls/CompositeDataBoundControl.cs
mcs/class/System.Web/System.Web.UI.WebControls/ContainedTable.cs
mcs/class/System.Web/System.Web.UI.WebControls/Content.cs
mcs/class/System.Web/System.Web.UI.WebControls/ContentControlBuilderInternal.cs
mcs/class/System.Web/System.Web.UI.WebControls/ContentDirection.cs
mcs/class/System.Web/System.Web.UI.WebControls/ContentPlaceHolder.cs
mcs/class/System.Web/System.Web.UI.WebControls/ContentPlaceHolderBuilder.cs
mcs/class/System.Web/System.Web.UI.WebControls/ControlIDConverter.cs
mcs/class/System.Web/System.Web.UI.WebControls/ControlParameter.cs
mcs/class/System.Web/System.Web.UI.WebControls/ControlPropertyNameConverter.cs
mcs/class/System.Web/System.Web.UI.WebControls/CookieParameter.cs
mcs/class/System.Web/System.Web.UI.WebControls/CreateUserErrorEventArgs.cs
mcs/class/System.Web/System.Web.UI.WebControls/CreateUserErrorEventHandler.cs
mcs/class/System.Web/System.Web.UI.WebControls/CreateUserWizard.cs
mcs/class/System.Web/System.Web.UI.WebControls/CreateUserWizardStep.cs
mcs/class/System.Web/System.Web.UI.WebControls/CustomValidator.cs

index eebd3826d5f099e15ec5ab5888a75d8c3d20ae7e..8d4ea9d48639603223e7112bd6ae7cb635064506 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Sanjay Gupta (gsanjay@novell.com)
 //
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System.IO;
 using System.ComponentModel;
 using System.Data.Common;
 using System.Drawing;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        // attributes
        [DesignerAttribute ("System.Web.UI.Design.WebControls.AccessDataSourceDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
        [ToolboxBitmap ("")]
-       public class AccessDataSource : SqlDataSource {
-
+       public class AccessDataSource : SqlDataSource
+       {
                const string PROVIDER_NAME = "System.Data.OleDb";
                const string PROVIDER_STRING = "Microsoft.Jet.OLEDB.4.0";
 
@@ -86,8 +84,8 @@ namespace System.Web.UI.WebControls {
 
                string GetPhysicalDataFilePath ()
                {
-                       if (DataFile == null || DataFile == "")
-                               return "";
+                       if (String.IsNullOrEmpty (DataFile))
+                               return String.Empty;
 
                        // more here?  how do we handle |DataDirectory|?
                        return HttpContext.Current.Request.MapPath (DataFile);
@@ -115,7 +113,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescriptionAttribute ("MS Office Access database file name")]
                [EditorAttribute ("System.Web.UI.Design.MdbDataFileEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
                public string DataFile {
-                       get { return ViewState.GetString ("DataFile", ""); }
+                       get { return ViewState.GetString ("DataFile", String.Empty); }
                        set {
                                ViewState ["DataFile"] = value;
                                connectionString = null;
@@ -129,7 +127,7 @@ namespace System.Web.UI.WebControls {
                        set { throw new InvalidOperationException
                                ("Setting ProviderName on an AccessDataSource is not allowed");
                        }
-               }               
+               }
        }
 }
-#endif
+
index 03c4a25fa2e03a8405ee2b6c1afd21255a7f154d..1421072494a21f58b1688e155b8e95257d62c764 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Text;
@@ -37,11 +36,11 @@ using System.ComponentModel;
 using System.Data.OleDb;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-       public class AccessDataSourceView : SqlDataSourceView {
-
+       public class AccessDataSourceView : SqlDataSourceView
+       {
                OleDbConnection oleConnection;
                OleDbCommand oleCommand;
                AccessDataSource dataSource;
@@ -81,5 +80,5 @@ namespace System.Web.UI.WebControls {
                }                                               
        }       
 }
-#endif
+
 
index f1f86b19ca6a8719f18bccb11eeb3a6e454f95c0..816faf32d1277d2d227ffa48584a0715367e32e8 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 using System.Collections;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_2_0
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-       public class AdCreatedEventArgs : EventArgs {
-#else
-       public sealed class AdCreatedEventArgs : EventArgs {
-#endif
+       public class AdCreatedEventArgs : EventArgs
+       {
                IDictionary properties;
 
                string alt_text;
index ea504d18d0d657d29b2d3a3da587f156b39ca7dd..e8eaf1e7516e6b7b7327f057b7b2907c7f8e9413 100644 (file)
@@ -4,7 +4,7 @@
 // Author:
 //        Ben Maurer <bmaurer@novell.com>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,8 +32,8 @@ using System.ComponentModel;
 using System.Security.Permissions;
 using System.Web.Util;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -41,42 +41,24 @@ namespace System.Web.UI.WebControls {
        [DefaultEvent("AdCreated")]
        [DefaultProperty("AdvertisementFile")]
        [Designer("System.Web.UI.Design.WebControls.AdRotatorDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
-#if NET_2_0
        [ToolboxData("<{0}:AdRotator runat=\"server\"></{0}:AdRotator>")]
-#else
-       [ToolboxData("<{0}:AdRotator runat=\"server\" Height=\"60px\" Width=\"468px\"></{0}:AdRotator>")]
-#endif         
-       public class AdRotator :
-#if NET_2_0
-       DataBoundControl
-#else          
-       WebControl
-#endif 
+       public class AdRotator : DataBoundControl
        {
-#if NET_2_0
+               AdCreatedEventArgs createdargs;
+               ArrayList ads = new ArrayList ();
+               string ad_file = String.Empty;
+
                protected internal override void OnInit (EventArgs e)
                {
                        base.OnInit(e);
                }
-#endif
-               
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void OnPreRender (EventArgs eee)
+
+               protected internal override void OnPreRender (EventArgs eee)
                {
                        Hashtable ht = null;
                        
-                       if (ad_file != "" && ad_file != null) {
-                               ReadAdsFromFile (
-#if NET_2_0
-                                       GetPhysicalFilePath (ad_file)
-#else
-                                       Page.MapPath (ad_file)
-#endif
-                               );
+                       if (!String.IsNullOrEmpty (ad_file)) {
+                               ReadAdsFromFile (GetPhysicalFilePath (ad_file));
                                ht = ChooseAd ();
                        }
 
@@ -86,7 +68,6 @@ namespace System.Web.UI.WebControls {
                        
                }
 
-#if NET_2_0
                [MonoTODO ("Not implemented")]
                protected internal override void PerformDataBinding (IEnumerable data)
                {
@@ -98,16 +79,8 @@ namespace System.Web.UI.WebControls {
                {
                        throw new NotImplementedException ();
                }
-#endif         
 
-               AdCreatedEventArgs createdargs;
-
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void Render (HtmlTextWriter w)
+               protected internal override void Render (HtmlTextWriter w)
                {
                        AdCreatedEventArgs e = createdargs;
 
@@ -123,7 +96,7 @@ namespace System.Web.UI.WebControls {
                        if (e.ImageUrl != null && e.ImageUrl.Length > 0)
                                w.AddAttribute (HtmlTextWriterAttribute.Src, ResolveAdUrl (e.ImageUrl));
 
-                       w.AddAttribute (HtmlTextWriterAttribute.Alt, e.AlternateText == null ? "" : e.AlternateText);
+                       w.AddAttribute (HtmlTextWriterAttribute.Alt, e.AlternateText == null ? String.Empty : e.AlternateText);
                        w.AddAttribute (HtmlTextWriterAttribute.Border, "0", false);
                        w.RenderBeginTag (HtmlTextWriterTag.Img);
                        w.RenderEndTag (); // img
@@ -160,16 +133,17 @@ namespace System.Web.UI.WebControls {
                        
                        int total_imp = 0;
                        int cur_imp = 0;
+                       bool keywordFilterEmpty = KeywordFilter.Length == 0;
                        
                        foreach (Hashtable a in ads) {
-                               if (KeywordFilter == "" || KeywordFilter == (string) a ["Keyword"])
+                               if (keywordFilterEmpty || KeywordFilter == (string) a ["Keyword"])
                                        total_imp += a ["Impressions"] != null ? int.Parse ((string) a ["Impressions"]) : 1;
                        }
 
                        int r = new Random ().Next (total_imp);
 
                        foreach (Hashtable a in ads) {
-                               if (KeywordFilter != "" && KeywordFilter != (string) a ["Keyword"])
+                               if (keywordFilterEmpty && KeywordFilter != (string) a ["Keyword"])
                                        continue;
                                cur_imp += a ["Impressions"] != null ? int.Parse ((string) a ["Impressions"]) : 1;
                                
@@ -182,8 +156,6 @@ namespace System.Web.UI.WebControls {
                        
                        return null;
                }
-
-               ArrayList ads = new ArrayList ();
                
                void ReadAdsFromFile (string s)
                {
@@ -206,12 +178,9 @@ namespace System.Web.UI.WebControls {
                                ads.Add (ad);
                        }
                }
-               
-               string ad_file = "";
 
-#if NET_2_0
+
                [UrlProperty]
-#endif         
                [Bindable(true)]
                [DefaultValue("")]
                [Editor("System.Web.UI.Design.XmlUrlEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))]
@@ -227,7 +196,6 @@ namespace System.Web.UI.WebControls {
                        
                }
 
-#if NET_2_0
                [DefaultValue ("AlternateText")]
                [WebSysDescriptionAttribute ("")]
                [WebCategoryAttribute ("Behavior")]
@@ -241,7 +209,6 @@ namespace System.Web.UI.WebControls {
                                throw new NotImplementedException ();
                        }
                }
-#endif         
                
                [Browsable(false)]
                [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -252,7 +219,6 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if NET_2_0
                [DefaultValue ("ImageUrl")]
                [MonoTODO ("Not implemented")]
                [WebSysDescriptionAttribute ("")]
@@ -266,8 +232,6 @@ namespace System.Web.UI.WebControls {
                                throw new NotImplementedException ();
                        }
                }
-#endif         
-               
 
                [Bindable(true)]
                [DefaultValue("")]
@@ -275,7 +239,7 @@ namespace System.Web.UI.WebControls {
                [WebCategory("Behavior")]
                public string KeywordFilter {
                        get {
-                               return ViewState.GetString ("KeywordFilter", "");
+                               return ViewState.GetString ("KeywordFilter", String.Empty);
                        }
                        set {
                                ViewState ["KeywordFilter"] = value;
@@ -283,7 +247,6 @@ namespace System.Web.UI.WebControls {
                        
                }
 
-#if NET_2_0
                [DefaultValue ("NavigateUrl")]
                [MonoTODO ("Not implemented")]
                [WebSysDescriptionAttribute ("")]
@@ -297,7 +260,6 @@ namespace System.Web.UI.WebControls {
                                throw new NotImplementedException ();
                        }
                }
-#endif         
                
                [Bindable(true)]
                [DefaultValue("_top")]
@@ -314,7 +276,6 @@ namespace System.Web.UI.WebControls {
                        
                }
 
-#if NET_2_0
                /* all these are listed in corcompare */
                public override string UniqueID
                {
@@ -329,7 +290,6 @@ namespace System.Web.UI.WebControls {
                                return base.TagKey;
                        }
                }
-#endif         
        
                protected virtual void OnAdCreated (AdCreatedEventArgs e)
                {
index b2a626c9a50f84fb2c6a1db82fe0c7d31f007c56..5b1bc53ab0f1e859aeef1c1dbbf3a842619a5dc8 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //      Sanjay Gupta (gsanjay@novell.com)
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining
@@ -27,8 +27,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-
-#if NET_2_0
 using System;
 
 namespace System.Web.UI.WebControls
@@ -47,5 +45,5 @@ namespace System.Web.UI.WebControls
                }               
        }
 }
-#endif
+
 
index 2cb091f76a759c13193506cef39a338bf0a0f619..57ecfb81854984babb816d15242d3802d1d7a994 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Sanjay Gupta (gsanjay@novell.com)
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -27,8 +27,9 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
-namespace System.Web.UI.WebControls {
+
+namespace System.Web.UI.WebControls
+{
        public class AuthenticateEventArgs : EventArgs 
        {
                bool authenticated;
@@ -48,4 +49,4 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
+
index af9abdb3342032910fb66a894d677ffcaaf568be..d7643b4fcd674d7bbe1c00477e3cb4fd5dacf2a5 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Sanjay Gupta (gsanjay@novell.com)
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -27,8 +27,8 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
-namespace System.Web.UI.WebControls {
+namespace System.Web.UI.WebControls
+{
        public delegate void AuthenticateEventHandler (object sender, AuthenticateEventArgs e);
 }
-#endif
+
index 328eb916b71a72d4e8a9ba2b32b7f1ccd9535ca2..2f9adb987b30377a8ee2d58739ecbd5fc0e244c4 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Sanjay Gupta (gsanjay@novell.com)
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-namespace System.Web.UI.WebControls {
-       public enum AutoCompleteType {
+namespace System.Web.UI.WebControls
+{
+       public enum AutoCompleteType
+       {
                None = 0,
                Disabled = 1,
                Cellular = 2,
@@ -64,5 +65,5 @@ namespace System.Web.UI.WebControls {
                Search = 31,
        } 
 }
-#endif
+
 
index 89f656d97a2aa063f80026567dad51687b5b5520..dadcc044b791750469d289b665ed7544a877df5b 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Web.UI;
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [EditorBrowsableAttribute (EditorBrowsableState.Never)]
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -154,4 +153,4 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
+
index 1c05b2e24402cf9bab8873e4ff86cc9d27179341..9d9f108baa2c38352cdf6511a3c35e3ea20ae5e9 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Web.UI;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        public sealed class AutoGeneratedFieldProperties: IStateManager
@@ -41,7 +40,7 @@ namespace System.Web.UI.WebControls {
                StateBag ViewState = new StateBag ();
 
                public string DataField {
-                       get { return ViewState.GetString ("DataField", ""); }
+                       get { return ViewState.GetString ("DataField", String.Empty); }
                        set { ViewState ["DataField"] = value; }
                }
                
@@ -51,7 +50,7 @@ namespace System.Web.UI.WebControls {
                }
                
                public string Name {
-                       get { return ViewState.GetString ("Name", ""); }
+                       get { return ViewState.GetString ("Name", String.Empty); }
                        set { ViewState ["Name"] = value; }
                }
                
@@ -86,4 +85,4 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
+
index b7b272785e0c4f9771009f780f1af8a9325672c6..5969ffcc9b3fa45a31aafbefb034428efc304b9b 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -33,49 +33,40 @@ using System.ComponentModel;
 using System.Security.Permissions;
 using System.Web.Util;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-       public abstract class BaseCompareValidator : BaseValidator {
-
-#if NET_2_0
-               protected
-#else
-               public
-#endif
-               BaseCompareValidator ()
+       public abstract class BaseCompareValidator : BaseValidator
+       {
+               protected BaseCompareValidator ()
                {
                }
 
                protected override void AddAttributesToRender (HtmlTextWriter w)
                {
                        if (RenderUplevel) {
-#if NET_2_0
-                               if (Page!=null){
+                               if (Page != null) {
                                        RegisterExpandoAttribute (ClientID, "type", Type.ToString ());
 
                                        switch (Type) {
-                                       case ValidationDataType.Date:
-                                               DateTimeFormatInfo dateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat;
-                                               string pattern = dateTimeFormat.ShortDatePattern;
-                                               string dateorder = (pattern.StartsWith ("y", true, Helpers.InvariantCulture) ? "ymd" : (pattern.StartsWith ("m", true, Helpers.InvariantCulture) ? "mdy" : "dmy"));
-                                               RegisterExpandoAttribute (ClientID, "dateorder", dateorder);
-                                               RegisterExpandoAttribute (ClientID, "cutoffyear", dateTimeFormat.Calendar.TwoDigitYearMax.ToString ());
-                                               break;
-                                       case ValidationDataType.Currency:
-                                               NumberFormatInfo numberFormat = CultureInfo.CurrentCulture.NumberFormat;
-                                               RegisterExpandoAttribute (ClientID, "decimalchar", numberFormat.CurrencyDecimalSeparator, true);
-                                               RegisterExpandoAttribute (ClientID, "groupchar", numberFormat.CurrencyGroupSeparator, true);
-                                               RegisterExpandoAttribute (ClientID, "digits", numberFormat.CurrencyDecimalDigits.ToString());
-                                               RegisterExpandoAttribute (ClientID, "groupsize", numberFormat.CurrencyGroupSizes [0].ToString ());
-                                               break;
+                                               case ValidationDataType.Date:
+                                                       DateTimeFormatInfo dateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat;
+                                                       string pattern = dateTimeFormat.ShortDatePattern;
+                                                       string dateorder = (pattern.StartsWith ("y", true, Helpers.InvariantCulture) ? "ymd" : (pattern.StartsWith ("m", true, Helpers.InvariantCulture) ? "mdy" : "dmy"));
+                                                       RegisterExpandoAttribute (ClientID, "dateorder", dateorder);
+                                                       RegisterExpandoAttribute (ClientID, "cutoffyear", dateTimeFormat.Calendar.TwoDigitYearMax.ToString ());
+                                                       break;
+                                               case ValidationDataType.Currency:
+                                                       NumberFormatInfo numberFormat = CultureInfo.CurrentCulture.NumberFormat;
+                                                       RegisterExpandoAttribute (ClientID, "decimalchar", numberFormat.CurrencyDecimalSeparator, true);
+                                                       RegisterExpandoAttribute (ClientID, "groupchar", numberFormat.CurrencyGroupSeparator, true);
+                                                       RegisterExpandoAttribute (ClientID, "digits", numberFormat.CurrencyDecimalDigits.ToString());
+                                                       RegisterExpandoAttribute (ClientID, "groupsize", numberFormat.CurrencyGroupSizes [0].ToString ());
+                                                       break;
                                        }
                                }
-#else
-                               w.AddAttribute ("datatype", Type.ToString());
-#endif
                        }
 
                        base.AddAttributesToRender (w);
@@ -96,10 +87,7 @@ namespace System.Web.UI.WebControls {
                        return BaseCompareValidator.Convert(text, type, false, out value);
                }
 
-               protected static bool Compare (string left,
-                                              string right,
-                                              ValidationCompareOperator op,
-                                              ValidationDataType type)
+               protected static bool Compare (string left, string right, ValidationCompareOperator op, ValidationDataType type)
                {
                        return BaseCompareValidator.Compare(left, false, right, false, op, type);       
                }
@@ -134,12 +122,10 @@ namespace System.Web.UI.WebControls {
                                if (c == 'm') {
                                        if (!seen_month) order.Append ("m");
                                        seen_month = true;
-                               }
-                               else if (c == 'y') {
+                               } else if (c == 'y') {
                                        if (!seen_year) order.Append ("y");
                                        seen_year = true;
-                               }
-                               else /* (c == 'd') */ {
+                               } else /* (c == 'd') */ {
                                        if (!seen_date) order.Append ("d");
                                        seen_date = true;
                                }
@@ -150,53 +136,32 @@ namespace System.Web.UI.WebControls {
 
                protected static int GetFullYear (int two_digit_year)
                {
-#if NET_2_0
                        /* This is an implementation that matches the
                         * docs on msdn, but MS doesn't seem to go by
                         * their docs (at least in 1.0). */
                        int cutoff = CutoffYear;
                        int twodigitcutoff = cutoff % 100;
 
-                       if (two_digit_year <= twodigitcutoff) {
+                       if (two_digit_year <= twodigitcutoff)
                                return cutoff - twodigitcutoff + two_digit_year;
-                       }
-                       else {
+                       else
                                return cutoff - twodigitcutoff - 100 + two_digit_year;
-                       }
-#else
-                       /* This is the broken implementation in 1.0 */
-                       int cutoff = CutoffYear;
-                       int twodigitcutoff = cutoff % 100;
-
-                       return cutoff - twodigitcutoff + two_digit_year;
-#endif
                }
 
-#if NET_2_0
                [DefaultValue (false)]
                [Themeable (false)]
-               public
-#else 
-               internal
-#endif
-            bool CultureInvariantValues {
+               public bool CultureInvariantValues {
                        get { return ViewState.GetBool ("CultureInvariantValues", false); }
                        set { ViewState ["CultureInvariantValues"] = value; }
                }
-
-
                
                protected static int CutoffYear {
-                       get {
-                               return CultureInfo.CurrentCulture.Calendar.TwoDigitYearMax;
-                       }
+                       get { return CultureInfo.CurrentCulture.Calendar.TwoDigitYearMax; }
                }
 
 
                [DefaultValue(ValidationDataType.String)]
-#if NET_2_0
                [Themeable (false)]
-#endif
                [WebSysDescription("")]
                [WebCategory("Behavior")]
                public ValidationDataType Type {
@@ -204,130 +169,99 @@ namespace System.Web.UI.WebControls {
                        set { ViewState ["Type"] = value; }
                }
 
-#if NET_2_0
-               
-               public
-#else 
-        internal
-#endif 
-        static bool CanConvert (string text, 
-                                              ValidationDataType type, 
-                                              bool cultureInvariant)
+               public static bool CanConvert (string text, ValidationDataType type, bool cultureInvariant)
                {
                        object value;
                        return Convert(text, type, cultureInvariant, out value);
                }
 
-#if NET_2_0
-               protected
-#else 
-        internal
-#endif 
-        static bool Compare (string left, 
+               protected static bool Compare (string left, 
                                               bool cultureInvariantLeftText, 
                                               string right, 
                                               bool cultureInvariantRightText, 
                                               ValidationCompareOperator op, 
                                               ValidationDataType type)
                {
-            object lo, ro;
-
-            if (!Convert(left, type, cultureInvariantLeftText, out lo))
-                return false;
-
-            /* DataTypeCheck is a unary operator that only
-             * depends on the lhs */
-            if (op == ValidationCompareOperator.DataTypeCheck)
-                return true;
-
-            /* pretty crackladen, but if we're unable to
-             * convert the rhs to @type, the comparison
-             * succeeds */
-            if (!Convert(right, type, cultureInvariantRightText, out ro))
-                return true;
-
-            int comp = ((IComparable)lo).CompareTo((IComparable)ro);
-
-            switch (op)
-            {
-                case ValidationCompareOperator.Equal:
-                    return comp == 0;
-                case ValidationCompareOperator.NotEqual:
-                    return comp != 0;
-                case ValidationCompareOperator.LessThan:
-                    return comp < 0;
-                case ValidationCompareOperator.LessThanEqual:
-                    return comp <= 0;
-                case ValidationCompareOperator.GreaterThan:
-                    return comp > 0;
-                case ValidationCompareOperator.GreaterThanEqual:
-                    return comp >= 0;
-                default:
-                    return false;
-            }
+                       object lo, ro;
+
+                       if (!Convert(left, type, cultureInvariantLeftText, out lo))
+                               return false;
+
+                       /* DataTypeCheck is a unary operator that only
+                        * depends on the lhs */
+                       if (op == ValidationCompareOperator.DataTypeCheck)
+                               return true;
+
+                       /* pretty crackladen, but if we're unable to
+                        * convert the rhs to @type, the comparison
+                        * succeeds */
+                       if (!Convert(right, type, cultureInvariantRightText, out ro))
+                               return true;
+
+                       int comp = ((IComparable)lo).CompareTo((IComparable)ro);
+
+                       switch (op) {
+                               case ValidationCompareOperator.Equal:
+                                       return comp == 0;
+                               case ValidationCompareOperator.NotEqual:
+                                       return comp != 0;
+                               case ValidationCompareOperator.LessThan:
+                                       return comp < 0;
+                               case ValidationCompareOperator.LessThanEqual:
+                                       return comp <= 0;
+                               case ValidationCompareOperator.GreaterThan:
+                                       return comp > 0;
+                               case ValidationCompareOperator.GreaterThanEqual:
+                                       return comp >= 0;
+                               default:
+                                       return false;
+                       }
                }
 
-#if NET_2_0
-       protected
-#else
-       internal
-#endif
-               static bool Convert (string text,
-                                              ValidationDataType type,
-                                              bool cultureInvariant,
-                                              out object value)
+               protected static bool Convert (string text, ValidationDataType type, bool cultureInvariant,out object value)
                {
-            try
-            {
-                switch (type)
-                {
-                    case ValidationDataType.String:
-                        value = text;
-                        return value != null;
-
-                    case ValidationDataType.Integer:
-                        IFormatProvider intFormatProvider = (cultureInvariant) ? 
-                            NumberFormatInfo.InvariantInfo :
-                            NumberFormatInfo.CurrentInfo;
-                        value = Int32.Parse(text, intFormatProvider);
-                        return true;
-
-                    case ValidationDataType.Double:
-                        IFormatProvider doubleFormatProvider = (cultureInvariant) ?
-                            NumberFormatInfo.InvariantInfo :
-                            NumberFormatInfo.CurrentInfo;
-                        value = Double.Parse(text, doubleFormatProvider);
-                        return true;
-
-                    case ValidationDataType.Date:
+                       try {
+                               switch (type) {
+                                       case ValidationDataType.String:
+                                               value = text;
+                                               return value != null;
+
+                                       case ValidationDataType.Integer:
+                                               IFormatProvider intFormatProvider = (cultureInvariant) ? NumberFormatInfo.InvariantInfo :
+                                               NumberFormatInfo.CurrentInfo;
+                                               value = Int32.Parse(text, intFormatProvider);
+                                               return true;
+
+                                       case ValidationDataType.Double:
+                                               IFormatProvider doubleFormatProvider = (cultureInvariant) ? NumberFormatInfo.InvariantInfo :
+                                               NumberFormatInfo.CurrentInfo;
+                                               value = Double.Parse(text, doubleFormatProvider);
+                                               return true;
+
+                                       case ValidationDataType.Date:
                         
-                        IFormatProvider dateFormatProvider = (cultureInvariant) ? 
-                            DateTimeFormatInfo.InvariantInfo :
-                            DateTimeFormatInfo.CurrentInfo;
-
-                        value = DateTime.Parse(text, dateFormatProvider);
-                        return true;
-
-                    case ValidationDataType.Currency:
-                        IFormatProvider currencyFormatProvider = (cultureInvariant) ?
-                            NumberFormatInfo.InvariantInfo :
-                            NumberFormatInfo.CurrentInfo;
-                        value = Decimal.Parse(text, NumberStyles.Currency, currencyFormatProvider);
-                        return true;
-
-                    default:
-                        value = null;
-                        return false;
-                }
-            }
-            catch
-            {
-                value = null;
-                return false;
-            }
+                                               IFormatProvider dateFormatProvider = (cultureInvariant) ? DateTimeFormatInfo.InvariantInfo :
+                                               DateTimeFormatInfo.CurrentInfo;
+
+                                               value = DateTime.Parse(text, dateFormatProvider);
+                                               return true;
+
+                                       case ValidationDataType.Currency:
+                                               IFormatProvider currencyFormatProvider = (cultureInvariant) ? NumberFormatInfo.InvariantInfo :
+                                               NumberFormatInfo.CurrentInfo;
+                                               value = Decimal.Parse(text, NumberStyles.Currency, currencyFormatProvider);
+                                               return true;
+
+                                       default:
+                                               value = null;
+                                               return false;
+                               }
+                       } catch {
+                               value = null;
+                               return false;
+                       }
                }
        }
-
 }
 
 
index b3c471287280be1701f27ccd84c965e22f802ca1..d8f573750f7dfc100e7bd565f8d60cb47ff99f8c 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -44,17 +43,16 @@ namespace System.Web.UI.WebControls {
                static readonly object dataBoundEvent = new object ();
 
                EventHandlerList events = new EventHandlerList ();
+               object dataSource;
+               bool initialized;
+               bool preRendered;
+               bool requiresDataBinding;
                
                public event EventHandler DataBound {
                        add { events.AddHandler (dataBoundEvent, value); }
                        remove { events.RemoveHandler (dataBoundEvent, value); }
                }
                
-               object dataSource;
-               bool initialized;
-               bool preRendered;
-               bool requiresDataBinding;
-               
                protected BaseDataBoundControl ()
                {
                }
@@ -71,9 +69,7 @@ namespace System.Web.UI.WebControls {
                [DefaultValueAttribute (null)]
                [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
                public virtual object DataSource {
-                       get {
-                               return dataSource;
-                       }
+                       get { return dataSource; }
                        set {
                                if(value!=null)
                                        ValidateDataSource (value);
@@ -85,9 +81,7 @@ namespace System.Web.UI.WebControls {
                [DefaultValueAttribute ("")]
                [ThemeableAttribute (false)]
                public virtual string DataSourceID {
-                       get {
-                               return ViewState.GetString ("DataSourceID", "");
-                       }
+                       get { return ViewState.GetString ("DataSourceID", String.Empty); }
                        set {
                                ViewState["DataSourceID"] = value;
                                OnDataPropertyChanged ();
@@ -205,7 +199,3 @@ namespace System.Web.UI.WebControls {
                
        }
 }
-
-#endif
-
-
index 75f9cf93cff0d711a96ec0b1d0138c455e8d9c82..e2b7899284f985a1ae3d8f550082cc43fe812c10 100644 (file)
@@ -4,7 +4,7 @@
 // Author:
 //     Sebastien Pouliot  <sebastien@ximian.com>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -30,8 +30,8 @@ using System.Collections;
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -45,14 +45,13 @@ namespace System.Web.UI.WebControls {
 
                DataKeyCollection keycoll;
                object source;
-#if NET_2_0
+
                //string dataSourceId;
                IDataSource boundDataSource = null;
                bool initialized;
                bool requiresDataBinding;
                DataSourceSelectArguments selectArguments;
                IEnumerable data;
-#endif
 
                protected BaseDataList ()
                {
@@ -60,13 +59,11 @@ namespace System.Web.UI.WebControls {
 
 
                [DefaultValue ("")]
-#if NET_2_0
                [Localizable (true)]
-#endif
                [WebSysDescription ("")]
                [WebCategory ("Accessibility")]
                public virtual string Caption {
-                       get { return ViewState.GetString ("Caption", ""); }
+                       get { return ViewState.GetString ("Caption", String.Empty); }
                        set {
                                if (value == null)
                                        ViewState.Remove ("Caption");
@@ -86,9 +83,6 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable (true)]
-#endif
                [DefaultValue (-1)]
                [WebSysDescription("")]
                [WebCategory("Layout")]
@@ -101,9 +95,6 @@ namespace System.Web.UI.WebControls {
                        set { TableStyle.CellPadding = value; }
                }
 
-#if ONLY_1_1
-               [Bindable (true)]
-#endif
                [DefaultValue (0)]
                [WebSysDescription("")]
                [WebCategory("Layout")]
@@ -124,14 +115,12 @@ namespace System.Web.UI.WebControls {
                }
 
                [DefaultValue ("")]
-#if NET_2_0
                [Themeable (false)]
-#endif
                [MonoTODO ("incomplete")]
                [WebSysDescription("")]
                [WebCategory("Data")]
                public virtual string DataKeyField {
-                       get { return ViewState.GetString ("DataKeyField", ""); }
+                       get { return ViewState.GetString ("DataKeyField", String.Empty); }
                        set {
                                if (value == null)
                                        ViewState.Remove ("DataKeyField");
@@ -164,59 +153,47 @@ namespace System.Web.UI.WebControls {
                }
 
                [DefaultValue ("")]
-#if NET_2_0
                [Themeable (false)]
-#endif
                [WebSysDescription("")]
                [WebCategory("Data")]
                public string DataMember {
-                       get { return ViewState.GetString ("DataMember", ""); }
+                       get { return ViewState.GetString ("DataMember", String.Empty); }
                        set {
                                if (value == null)
                                        ViewState.Remove ("DataMember");
                                else
                                        ViewState ["DataMember"] = value;
-#if NET_2_0
                                OnDataPropertyChanged ();
-#endif
                        }
                }
 
                [Bindable (true)]
                [DefaultValue (null)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-#if NET_2_0
                [Themeable (false)]
-#endif
                [WebSysDescription("")]
                [WebCategory("Data")]
-               public virtual object DataSource {
+                       public virtual object DataSource {
                        get { return source; }
                        set {
                                if ((value == null) || (value is IEnumerable) || (value is IListSource)) {
-#if NET_2_0
-// FIXME - can't duplicate in a test case ? LAMESPEC ?
-// can't duplicate in a test case
-//                                     if ((dataSourceId != null) && (dataSourceId.Length != 0))
-//                                             throw new HttpException (Locale.GetText ("DataSourceID is already set."));
+                                       // FIXME - can't duplicate in a test case ? LAMESPEC ?
+                                       // can't duplicate in a test case
+                                       // if ((dataSourceId != null) && (dataSourceId.Length != 0))
+                                       //      throw new HttpException (Locale.GetText ("DataSourceID is already set."));
 
                                        source = value;
 
                                        OnDataPropertyChanged ();
-#else
-                                       source = value;
-#endif
+
                                } else {
                                        string msg = Locale.GetText ("Invalid data source. This requires an object implementing {0} or {1}.",
-                                               "IEnumerable", "IListSource");
+                                                                    "IEnumerable", "IListSource");
                                        throw new ArgumentException (msg);
                                }
                        }
                }
 
-#if ONLY_1_1
-               [Bindable (true)]
-#endif
                [DefaultValue (GridLines.Both)]
                [WebSysDescription("")]
                [WebCategory("Appearance")]
@@ -229,9 +206,6 @@ namespace System.Web.UI.WebControls {
                        set { TableStyle.GridLines = value; }
                }
 
-#if ONLY_1_1
-               [Bindable (true)]
-#endif
                [Category ("Layout")]
                [DefaultValue (HorizontalAlign.NotSet)]
                [WebSysDescription("")]
@@ -249,12 +223,12 @@ namespace System.Web.UI.WebControls {
                        get { return ViewState.GetBool ("UseAccessibleHeader", false); }
                        set { ViewState ["UseAccessibleHeader"] = value; }
                }
-#if NET_2_0
+
                [DefaultValue ("")]
                [IDReferenceProperty (typeof (DataSourceControl))]
                [Themeable (false)]
                public virtual string DataSourceID {
-                       get { return ViewState.GetString ("DataSourceID", ""); }
+                       get { return ViewState.GetString ("DataSourceID", String.Empty); }
                        set {
                                // LAMESPEC ? this is documented as an HttpException in beta2
                                if (source != null)
@@ -288,7 +262,7 @@ namespace System.Web.UI.WebControls {
                                return selectArguments;
                        }
                }
-#endif
+
                TableStyle TableStyle {
                        // this will throw an InvalidCasException just like we need
                        get { return (TableStyle) ControlStyle; }
@@ -301,27 +275,16 @@ namespace System.Web.UI.WebControls {
                }
 
                // see Kothari, page 435
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void CreateChildControls ()
+               protected internal override void CreateChildControls ()
                {
                        // We are recreating the children from viewstate
                        if (HasControls ())
                                base.Controls.Clear();
 
-#if NET_2_0
                        if (IsDataBound)
                                CreateControlHierarchy (false);
                        else if (RequiresDataBinding)
                                EnsureDataBound ();
-#else
-                       // If presents, build the children from the viewstate
-                       if (ViewState ["Items"] != null)
-                               CreateControlHierarchy (false);
-#endif
                }
 
                protected abstract void CreateControlHierarchy (bool useDataSource);
@@ -346,12 +309,10 @@ namespace System.Web.UI.WebControls {
                        // Indicate that child controls have been created, preventing
                        // CreateChildControls from getting called.
                        ChildControlsCreated = true;    
-#if NET_2_0
                        RequiresDataBinding = false;
                        IsDataBound = true;
-#endif
                }
-#if NET_2_0
+
                protected virtual DataSourceSelectArguments CreateDataSourceSelectArguments ()
                {
                        return DataSourceSelectArguments.Empty;
@@ -391,13 +352,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#endif
-
                protected override void OnDataBinding (EventArgs e)
                {
                        base.OnDataBinding (e);
                }
-#if NET_2_0
+
                protected virtual void OnDataPropertyChanged ()
                {
                        if (Initialized)
@@ -412,10 +371,11 @@ namespace System.Web.UI.WebControls {
                protected internal override void OnInit (EventArgs e)
                {
                        base.OnInit (e);
-                       if (Page != null) {
-                               Page.PreLoad += new EventHandler (OnPagePreLoad);
+                       Page page = Page;
+                       if (page != null) {
+                               page.PreLoad += new EventHandler (OnPagePreLoad);
 
-                               if (!IsViewStateEnabled && Page.IsPostBack)
+                               if (!IsViewStateEnabled && page.IsPostBack)
                                        RequiresDataBinding = true;
                        }
                }
@@ -435,8 +395,9 @@ namespace System.Web.UI.WebControls {
                
                void Initialize ()
                {
-                       if (Page != null) {
-                               if (!Page.IsPostBack || (IsViewStateEnabled && !IsDataBound))
+                       Page page = Page;
+                       if (page != null) {
+                               if (!page.IsPostBack || (IsViewStateEnabled && !IsDataBound))
                                        RequiresDataBinding = true;
                        }
 
@@ -451,7 +412,7 @@ namespace System.Web.UI.WebControls {
                        EnsureDataBound ();
                        base.OnPreRender (e);
                }
-#endif
+
                protected virtual void OnSelectedIndexChanged (EventArgs e)
                {
                        EventHandler selectedIndexChanged = (EventHandler) Events [selectedIndexChangedEvent];
@@ -461,12 +422,7 @@ namespace System.Web.UI.WebControls {
 
                protected abstract void PrepareControlHierarchy ();
 
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void Render (HtmlTextWriter writer)
+               protected internal override void Render (HtmlTextWriter writer)
                {
                        PrepareControlHierarchy ();
                        // don't call base class or RenderBegin|EndTag
@@ -474,7 +430,6 @@ namespace System.Web.UI.WebControls {
                        RenderContents (writer);
                }
 
-
                [WebSysDescription("")]
                [WebCategory("Action")]
                public event EventHandler SelectedIndexChanged {
@@ -482,7 +437,6 @@ namespace System.Web.UI.WebControls {
                        remove { Events.RemoveHandler (selectedIndexChangedEvent, value); }
                }
 
-
                static public bool IsBindableType (Type type)
                {
                        // I can't believe how many NRE are possible in System.Web
@@ -490,28 +444,27 @@ namespace System.Web.UI.WebControls {
                                throw new NullReferenceException ();
 
                        switch (Type.GetTypeCode (type)) {
-                       case TypeCode.Boolean:
-                       case TypeCode.Byte:
-                       case TypeCode.SByte:
-                       case TypeCode.Int16:
-                       case TypeCode.UInt16:
-                       case TypeCode.Int32:
-                       case TypeCode.UInt32:
-                       case TypeCode.Int64:
-                       case TypeCode.UInt64:
-                       case TypeCode.Char:
-                       case TypeCode.Double:
-                       case TypeCode.Single:
-                       case TypeCode.DateTime:
-                       case TypeCode.Decimal:
-                       case TypeCode.String:
-                               return true;
-                       default:
-                               return false;
+                               case TypeCode.Boolean:
+                               case TypeCode.Byte:
+                               case TypeCode.SByte:
+                               case TypeCode.Int16:
+                               case TypeCode.UInt16:
+                               case TypeCode.Int32:
+                               case TypeCode.UInt32:
+                               case TypeCode.Int64:
+                               case TypeCode.UInt64:
+                               case TypeCode.Char:
+                               case TypeCode.Double:
+                               case TypeCode.Single:
+                               case TypeCode.DateTime:
+                               case TypeCode.Decimal:
+                               case TypeCode.String:
+                                       return true;
+                               default:
+                                       return false;
                        }
                }
 
-#if NET_2_0
                void ConnectToDataSource ()
                {
                        if (NamingContainer != null)
@@ -527,6 +480,5 @@ namespace System.Web.UI.WebControls {
                        DataSourceView dsv = boundDataSource.GetView (String.Empty);
                        dsv.DataSourceViewChanged += new EventHandler (OnDataSourceViewChanged);
                }
-#endif
        }
 }
index 8ec6ceaef39c2f649a5268580d6b61b9bd9247de..bdfe1af918454faa5b1545ffab9ad6b6692b3390 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -33,8 +33,8 @@ using System.Reflection;
 using System.Collections;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -46,6 +46,7 @@ namespace System.Web.UI.WebControls {
                bool render_uplevel;
                bool valid;
                Color forecolor;
+               bool pre_render_called = false;
 
                protected BaseValidator ()
                {
@@ -55,20 +56,12 @@ namespace System.Web.UI.WebControls {
 
                // New in NET1.1 sp1
                [Browsable(false)]
-#if ONLY_1_1
-               [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-#endif         
                [EditorBrowsable(EditorBrowsableState.Never)]
                public override string AssociatedControlID {
-                       get {
-                               return base.AssociatedControlID;
-                       }
-                       set {
-                               base.AssociatedControlID = value;
-                       }
+                       get { return base.AssociatedControlID; }
+                       set { base.AssociatedControlID = value; }
                }
 
-#if NET_2_0
                [Themeable (false)]
                [DefaultValue ("")]
                public virtual string ValidationGroup {
@@ -92,12 +85,9 @@ namespace System.Web.UI.WebControls {
                        get { return base.Text; }
                        set { base.Text = value; }
                }
-#endif
 
-#if NET_2_0
                [IDReferenceProperty (typeof (Control))]
                [Themeable (false)]
-#endif
                [TypeConverter(typeof(System.Web.UI.WebControls.ValidatedControlConverter))]
                [DefaultValue("")]
                [WebSysDescription ("")]
@@ -107,12 +97,7 @@ namespace System.Web.UI.WebControls {
                        set { ViewState ["ControlToValidate"] = value; }
                }
 
-#if NET_2_0
                [Themeable (false)]
-#endif
-#if ONLY_1_1           
-               [Bindable(true)]
-#endif         
                [DefaultValue(ValidatorDisplay.Static)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
@@ -121,9 +106,7 @@ namespace System.Web.UI.WebControls {
                        set { ViewState ["Display"] = (int)value; }
                }
 
-#if NET_2_0
                [Themeable (false)]
-#endif
                [DefaultValue(true)]
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
@@ -137,21 +120,11 @@ namespace System.Web.UI.WebControls {
                        set { ViewState ["BaseValidatorEnabled"] = value; }
                }
 
-#if NET_2_0
                [Localizable (true)]
-#endif
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue("")]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
-#if NET_2_0
-               public
-#else
-               public virtual
-#endif
-               string ErrorMessage {
+               public string ErrorMessage {
                        get { return ViewState.GetString ("ErrorMessage", String.Empty); }
                        set { ViewState ["ErrorMessage"] = value; }
                }
@@ -167,18 +140,11 @@ namespace System.Web.UI.WebControls {
 
                [Browsable(false)]
                [DefaultValue(true)]
-#if NET_2_0
                [Themeable (false)]
-#endif
                [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
                [WebSysDescription ("")]
                [WebCategory ("Misc")]
-#if NET_2_0
-               public
-#else
-               public virtual
-#endif
-               bool IsValid {
+               public bool IsValid {
                        get { return valid; }
                        set { valid = value; }
                }
@@ -211,44 +177,23 @@ namespace System.Web.UI.WebControls {
                                        writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
 
                                if (ControlToValidate != String.Empty)
-#if NET_2_0
                                        RegisterExpandoAttribute (ClientID, "controltovalidate", GetControlRenderID (ControlToValidate));
-#else
-                                       writer.AddAttribute ("controltovalidate", GetControlRenderID (ControlToValidate));
-#endif
 
                                if (ErrorMessage != String.Empty)
-#if NET_2_0
                                        RegisterExpandoAttribute (ClientID, "errormessage", ErrorMessage, true);
-#else
-                                       writer.AddAttribute ("errormessage", ErrorMessage);
 
-                               if (Text != String.Empty)
-                                       writer.AddAttribute ("text", Text);
-#endif
-
-#if NET_2_0
                                if (ValidationGroup != String.Empty)
                                        RegisterExpandoAttribute (ClientID, "validationGroup", ValidationGroup, true);
 
                                if (SetFocusOnError)
                                        RegisterExpandoAttribute (ClientID, "focusOnError", "t");
-#endif
-                               if (!IsEnabled)
-#if NET_2_0
+
+                               bool enabled = IsEnabled;
+                               if (!enabled)
                                        RegisterExpandoAttribute (ClientID, "enabled", "False");
-#else
-                                       writer.AddAttribute ("enabled", "false", false);
-#endif
 
-#if NET_2_0
-                               if (IsEnabled && !IsValid) {
+                               if (enabled && !IsValid)
                                        RegisterExpandoAttribute (ClientID, "isvalid", "False");
-#else
-                               if (!IsValid) {
-                                       writer.AddAttribute ("isvalid", "false", false);
-#endif
-                               }
                                else {
                                        if (Display == ValidatorDisplay.Static)
                                                writer.AddStyleAttribute ("visibility", "hidden");
@@ -257,28 +202,25 @@ namespace System.Web.UI.WebControls {
                                }
 
                                if (Display != ValidatorDisplay.Static)
-#if NET_2_0
                                        RegisterExpandoAttribute (ClientID, "display", Display.ToString ());
-#else
-                                       writer.AddAttribute ("display", Display.ToString());
-#endif
                        }
 
                        base.AddAttributesToRender (writer);
                }
 
-#if NET_2_0
-               internal void RegisterExpandoAttribute (string controlId, string attributeName, string attributeValue) {
+               internal void RegisterExpandoAttribute (string controlId, string attributeName, string attributeValue)
+               {
                        RegisterExpandoAttribute (controlId, attributeName, attributeValue, false);
                }
 
-               internal void RegisterExpandoAttribute (string controlId, string attributeName, string attributeValue, bool encode) {
-                       if (Page.ScriptManager != null)
-                               Page.ScriptManager.RegisterExpandoAttributeExternal (this, controlId, attributeName, attributeValue, encode);
+               internal void RegisterExpandoAttribute (string controlId, string attributeName, string attributeValue, bool encode)
+               {
+                       Page page = Page;
+                       if (page.ScriptManager != null)
+                               page.ScriptManager.RegisterExpandoAttributeExternal (this, controlId, attributeName, attributeValue, encode);
                        else
-                               Page.ClientScript.RegisterExpandoAttribute (controlId, attributeName, attributeValue, encode);
+                               page.ClientScript.RegisterExpandoAttribute (controlId, attributeName, attributeValue, encode);
                }
-#endif
 
                protected void CheckControlValidationProperty (string name, string propertyName)
                {
@@ -299,7 +241,7 @@ namespace System.Web.UI.WebControls {
                                throw new HttpException (String.Format ("ControlToValidate property of '{0}' cannot be blank.", ID));
                        }
 
-                       CheckControlValidationProperty (ControlToValidate, "");
+                       CheckControlValidationProperty (ControlToValidate, String.Empty);
 
                        return true;
                }
@@ -381,32 +323,18 @@ namespace System.Web.UI.WebControls {
                        return null;
                }
 
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void OnInit (EventArgs e)
+               protected internal override void OnInit (EventArgs e)
                {
+                       Page page = Page;
                        /* according to an msdn article, this is done here */
-                       if (Page != null) {
-                               Page.Validators.Add (this);
-
-#if NET_2_0
-                               Page.GetValidators (ValidationGroup).Add (this);
-#endif
+                       if (page != null) {
+                               page.Validators.Add (this);
+                               page.GetValidators (ValidationGroup).Add (this);
                        }
                        base.OnInit (e);
                }
 
-               bool pre_render_called = false;
-
-#if NET_2_0
-               protected internal
-#else
-               protected
-#endif         
-               override void OnPreRender (EventArgs e)
+               protected internal override void OnPreRender (EventArgs e)
                {
                        base.OnPreRender (e);
 
@@ -415,104 +343,64 @@ namespace System.Web.UI.WebControls {
                        ControlPropertiesValid ();
 
                        render_uplevel = DetermineRenderUplevel ();
-                       if (render_uplevel) {
+                       if (render_uplevel)
                                RegisterValidatorCommonScript ();
-                       }
                }
 
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void OnUnload (EventArgs e)
+               protected internal override void OnUnload (EventArgs e)
                {
+                       Page page = Page;
                        /* according to an msdn article, this is done here */
-                       if (Page != null) {
-                               Page.Validators.Remove (this);
-
-#if NET_2_0
-                               if (ValidationGroup != "")
-                                       Page.GetValidators (ValidationGroup).Remove (this);
-#endif
-
+                       if (page != null) {
+                               page.Validators.Remove (this);
+                               string validationGroup = ValidationGroup;
+                               if (!String.IsNullOrEmpty (validationGroup))
+                                       page.GetValidators (ValidationGroup).Remove (this);
                        }
                        base.OnUnload (e);
                }
 
                protected void RegisterValidatorCommonScript ()
                {
-#if NET_2_0
-                       if (Page.ScriptManager != null) {
-                               Page.ScriptManager.RegisterClientScriptResourceExternal (this, typeof (BaseValidator), "WebUIValidation_2.0.js");
-                               Page.ScriptManager.RegisterClientScriptBlockExternal (this, typeof (BaseValidator), "ValidationInitializeScript", Page.ValidationInitializeScript, true);
-                               Page.ScriptManager.RegisterOnSubmitStatementExternal (this, typeof (BaseValidator), "ValidationOnSubmitStatement", Page.ValidationOnSubmitStatement);
-                               Page.ScriptManager.RegisterStartupScriptExternal (this, typeof (BaseValidator), "ValidationStartupScript", Page.ValidationStartupScript, true);
-                       }
-                       else
-#endif
-                       if (!Page.ClientScript.IsClientScriptIncludeRegistered (typeof (BaseValidator), "Mono-System.Web-ValidationClientScriptBlock"))
-                       {
-                               Page.ClientScript.RegisterClientScriptInclude (typeof (BaseValidator), "Mono-System.Web-ValidationClientScriptBlock",
-                                       Page.ClientScript.GetWebResourceUrl (typeof (BaseValidator), 
-#if NET_2_0
-                                               "WebUIValidation_2.0.js"));
-                               Page.ClientScript.RegisterClientScriptBlock (typeof (BaseValidator), "Mono-System.Web-ValidationClientScriptBlock.Initialize", Page.ValidationInitializeScript, true);
-                               Page.ClientScript.RegisterOnSubmitStatement (typeof (BaseValidator), "Mono-System.Web-ValidationOnSubmitStatement", Page.ValidationOnSubmitStatement);
-                               Page.ClientScript.RegisterStartupScript (typeof (BaseValidator), "Mono-System.Web-ValidationStartupScript", Page.ValidationStartupScript, true);
-#else          
-                                               "WebUIValidation.js"));
-
-                               Page.ClientScript.RegisterOnSubmitStatement ("Mono-System.Web-ValidationOnSubmitStatement",
-                                                                            "if (!ValidatorOnSubmit()) return false;");
-                               Page.ClientScript.RegisterStartupScript ("Mono-System.Web-ValidationStartupScript",
-                                                                        "<script language=\"JavaScript\">\n" + 
-                                                                        "<!--\n" + 
-                                                                        "var Page_ValidationActive = false;\n" + 
-                                                                        "ValidatorOnLoad();\n" +
-                                                                        "\n" + 
-                                                                        "function ValidatorOnSubmit() {\n" + 
-                                                                        "        if (Page_ValidationActive) {\n" + 
-                                                                        "                if (!ValidatorCommonOnSubmit())\n" +
-                                                                        "                        return Page_ClientValidate ();\n" +
-                                                                        "        }\n" + 
-                                                                        "        return true;\n" + 
-                                                                        "}\n" + 
-                                                                        "// -->\n" + 
-                                                                        "</script>\n");
-#endif
+                       Page page = Page;
+                       if (page != null) {
+                               if (page.ScriptManager != null) {
+                                       page.ScriptManager.RegisterClientScriptResourceExternal (this, typeof (BaseValidator), "WebUIValidation_2.0.js");
+                                       page.ScriptManager.RegisterClientScriptBlockExternal (this, typeof (BaseValidator), "ValidationInitializeScript", page.ValidationInitializeScript, true);
+                                       page.ScriptManager.RegisterOnSubmitStatementExternal (this, typeof (BaseValidator), "ValidationOnSubmitStatement", page.ValidationOnSubmitStatement);
+                                       page.ScriptManager.RegisterStartupScriptExternal (this, typeof (BaseValidator), "ValidationStartupScript", page.ValidationStartupScript, true);
+                               } else if (!page.ClientScript.IsClientScriptIncludeRegistered (typeof (BaseValidator), "Mono-System.Web-ValidationClientScriptBlock")) {
+                                       page.ClientScript.RegisterClientScriptInclude (typeof (BaseValidator), "Mono-System.Web-ValidationClientScriptBlock",
+                                                                                      page.ClientScript.GetWebResourceUrl (typeof (BaseValidator), "WebUIValidation_2.0.js"));
+                                       page.ClientScript.RegisterClientScriptBlock (typeof (BaseValidator), "Mono-System.Web-ValidationClientScriptBlock.Initialize", page.ValidationInitializeScript, true);
+                                       page.ClientScript.RegisterOnSubmitStatement (typeof (BaseValidator), "Mono-System.Web-ValidationOnSubmitStatement", page.ValidationOnSubmitStatement);
+                                       page.ClientScript.RegisterStartupScript (typeof (BaseValidator), "Mono-System.Web-ValidationStartupScript", page.ValidationStartupScript, true);
+                               }
                        }
                }
 
                protected virtual void RegisterValidatorDeclaration ()
                {
-#if NET_2_0
-                       if (Page.ScriptManager != null) {
-                               Page.ScriptManager.RegisterArrayDeclarationExternal (this, "Page_Validators", String.Concat ("document.getElementById ('", ClientID, "')"));
-                               Page.ScriptManager.RegisterStartupScriptExternal (this, typeof (BaseValidator), ClientID + "DisposeScript",
-@"
+                       Page page = Page;
+                       if (page != null) {
+                               if (page.ScriptManager != null) {
+                                       page.ScriptManager.RegisterArrayDeclarationExternal (this, "Page_Validators", String.Concat ("document.getElementById ('", ClientID, "')"));
+                                       page.ScriptManager.RegisterStartupScriptExternal (this, typeof (BaseValidator), ClientID + "DisposeScript",
+                                                                                         @"
 document.getElementById('" + ClientID + @"').dispose = function() {
     Array.remove(Page_Validators, document.getElementById('" + ClientID + @"'));
 }
 ", true);
+                               } else
+                                       page.ClientScript.RegisterArrayDeclaration ("Page_Validators", String.Concat ("document.getElementById ('", ClientID, "')"));
                        }
-                       else
-#endif
-                       Page.ClientScript.RegisterArrayDeclaration ("Page_Validators",
-                                                                   String.Concat ("document.getElementById ('", ClientID, "')"));
                }
 
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void Render (HtmlTextWriter writer)
+               protected internal override void Render (HtmlTextWriter writer)
                {
-#if NET_2_0
                        if (!IsEnabled && !EnableClientScript)
                                return;
-#endif
+
                        if (render_uplevel) {
                                /* according to an msdn article, this is done here */
                                RegisterValidatorDeclaration ();
@@ -526,17 +414,10 @@ document.getElementById('" + ClientID + @"').dispose = function() {
                        if (!pre_render_called) {
                                render_tags = true;
                                render_text = true;
-                       }
-                       else if (render_uplevel) {
+                       } else if (render_uplevel) {
                                render_tags = true;
-#if NET_2_0
                                render_text = Display != ValidatorDisplay.None;
-#else
-                               if (Display != ValidatorDisplay.None)
-                                       render_text = !v || Display == ValidatorDisplay.Dynamic;
-#endif
-                       }
-                       else {
+                       } else {
                                if (Display != ValidatorDisplay.None) {
                                        render_tags = !v;
                                        render_text = !v;
@@ -553,28 +434,21 @@ document.getElementById('" + ClientID + @"').dispose = function() {
                                string text;
                                if (render_text) {
                                        text = Text;
-                                       if (text == "")
+                                       if (String.IsNullOrEmpty (text))
                                                text = ErrorMessage;
-                               } else {
+                               } else
                                        text = "&nbsp;";
-                               }
 
                                writer.Write (text);
                        }
 
 
-                       if (render_tags) {
+                       if (render_tags)
                                writer.RenderEndTag ();
-                       }
                }
 
                /* the docs say "public sealed" here */
-#if NET_2_0
-               public
-#else
-               public virtual
-#endif
-               void Validate ()
+               public void Validate ()
                {
                        if (IsEnabled && Visible)
                                IsValid = ControlPropertiesValid () && EvaluateIsValid ();
@@ -582,5 +456,4 @@ document.getElementById('" + ClientID + @"').dispose = function() {
                                IsValid = true;
                }
        }
-
 }
index 90829be09d978bb6ae8a3c66a0b6d117a8051a1d..c3d11efacc2e65103c5c024edab6a34b50f94c61 100644 (file)
@@ -4,7 +4,7 @@
 // Author:
 //      Dick Porter  <dick@ximian.com>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace System.Web.UI.WebControls {
-#if !NET_2_0
-       [Serializable]
-#endif
-       public enum BorderStyle {
+namespace System.Web.UI.WebControls
+{
+       public enum BorderStyle
+       {
                NotSet,
                None,
                Dotted,
index 9fd99ad98b8af38a357cbd535aac8fd24730ee3a..c06bc8791a2dec218f0cc8c5dd94a3df07244651 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Web.UI;
@@ -36,8 +35,8 @@ using System.ComponentModel;
 using System.Security.Permissions;
 using System.Reflection;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        public class BoundField : DataControlField
@@ -50,12 +49,8 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Behavior")]
                public virtual bool ApplyFormatInEditMode {
-                       get {
-                               return ViewState.GetBool ("ApplyFormatInEditMode", false);
-                       }
-                       set {
-                               ViewState ["ApplyFormatInEditMode"] = value;
-                       }
+                       get { return ViewState.GetBool ("ApplyFormatInEditMode", false); }
+                       set { ViewState ["ApplyFormatInEditMode"] = value; }
                }
                
                [DefaultValueAttribute (true)]
@@ -74,7 +69,7 @@ namespace System.Web.UI.WebControls {
                [WebCategoryAttribute ("Data")]
                [DefaultValueAttribute ("")]
                public virtual string DataField {
-                       get { return ViewState.GetString ("DataField", ""); }
+                       get { return ViewState.GetString ("DataField", String.Empty); }
                        set {
                                ViewState ["DataField"] = value;
                                OnFieldChanged ();
@@ -85,7 +80,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Data")]
                public virtual string DataFormatString {
-                       get { return ViewState.GetString ("DataFormatString", ""); }
+                       get { return ViewState.GetString ("DataFormatString", String.Empty); }
                        set {
                                ViewState ["DataFormatString"] = value;
                                OnFieldChanged ();
@@ -95,8 +90,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public override string HeaderText {
-                       get { return ViewState.GetString ("HeaderText", "");
-                       }
+                       get { return ViewState.GetString ("HeaderText", String.Empty); }
                        set {
                                ViewState["HeaderText"] = value;
                                OnFieldChanged ();
@@ -106,7 +100,7 @@ namespace System.Web.UI.WebControls {
                [DefaultValueAttribute ("")]
                [WebCategoryAttribute ("Behavior")]
                public virtual string NullDisplayText {
-                       get { return ViewState.GetString ("NullDisplayText", ""); }
+                       get { return ViewState.GetString ("NullDisplayText", String.Empty); }
                        set {
                                ViewState ["NullDisplayText"] = value;
                                OnFieldChanged ();
@@ -144,13 +138,11 @@ namespace System.Web.UI.WebControls {
                                        TextBox box = (TextBox) cell.Controls [0];
                                        dictionary [DataField] = box.Text;
                                }
-                       } else if (includeReadOnly) {
+                       } else if (includeReadOnly)
                                dictionary [DataField] = cell.Text;
-                       }
                }
 
-               public override bool Initialize (bool enableSorting, 
-                                                Control control)
+               public override bool Initialize (bool enableSorting, Control control)
                {
                        return base.Initialize (enableSorting, control);
                }
@@ -193,11 +185,9 @@ namespace System.Web.UI.WebControls {
                                if (NullDisplayText.Length == 0) {
                                        encode = false;
                                        res = "&nbsp;";
-                               }
-                               else
+                               } else
                                        res = NullDisplayText;
-                       }
-                       else if (DataFormatString.Length > 0)
+                       } else if (DataFormatString.Length > 0)
                                res = string.Format (DataFormatString, value);
                        else
                                res = stringValue;
@@ -279,4 +269,4 @@ namespace System.Web.UI.WebControls {
 
        }
 }
-#endif
+
index 63f60d2719db3abffb04769a40a77037f0050b36..41005efd653315c773fefce0b6fddb37b4b8c909 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-namespace System.Web.UI.WebControls {
-       public enum BulletStyle {
+namespace System.Web.UI.WebControls
+{
+       public enum BulletStyle
+       {
                NotSet,
                Numbered,
                LowerAlpha,
@@ -43,4 +44,3 @@ namespace System.Web.UI.WebControls {
                CustomImage,
        }
 }
-#endif
\ No newline at end of file
index 443fb2db3f07789ed007dec8adcb3dddd2c7c230..06ba6a97572b33677ec3ba9b554460d6f8849e89 100644 (file)
@@ -27,7 +27,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
+
 using System.IO;
 using System.Collections;
 using System.Globalization;
@@ -38,8 +38,8 @@ using System.ComponentModel.Design;
 using System.Security.Permissions;
 using System.Web.Util;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -48,10 +48,16 @@ namespace System.Web.UI.WebControls {
        [DefaultEventAttribute ("Click")]
        [DefaultPropertyAttribute ("BulletStyle")]
        [SupportsEventValidation]
-       public class BulletedList : ListControl, IPostBackEventHandler {
-               
+       public class BulletedList : ListControl, IPostBackEventHandler
+       {
+               static readonly object ClickEvent = new object ();
                PostBackOptions postBackOptions;
-
+               
+               public event BulletedListEventHandler Click {
+                       add { Events.AddHandler (ClickEvent, value); }
+                       remove { Events.RemoveHandler (ClickEvent, value); }
+               }
+               
                [MonoTODO ("we are missing a new style enum, we should be using it")]
                protected override void AddAttributesToRender (HtmlTextWriter writer)
                {
@@ -59,8 +65,7 @@ namespace System.Web.UI.WebControls {
                        const string ListStyleImage = "list-style-image";
                        
                        bool isNumeric = false;
-                       switch (BulletStyle)
-                       {
+                       switch (BulletStyle) {
                                case BulletStyle.NotSet:
                                        break;
                                
@@ -136,8 +141,7 @@ namespace System.Web.UI.WebControls {
                                                if (Target.Length > 0)
                                                        writer.AddAttribute(HtmlTextWriterAttribute.Target, this.Target);
                                                
-                                       }
-                                       else
+                                       } else
                                                writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
                                        
                                        writer.RenderBeginTag (HtmlTextWriterTag.A);
@@ -157,7 +161,8 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-               PostBackOptions GetPostBackOptions (string argument) {
+               PostBackOptions GetPostBackOptions (string argument)
+               {
                        if (postBackOptions == null) {
                                postBackOptions = new PostBackOptions (this);
                                postBackOptions.ActionUrl = null;
@@ -175,17 +180,16 @@ namespace System.Web.UI.WebControls {
                protected internal override void RenderContents (HtmlTextWriter writer)
                {
                        int idx = 0;
-#if NET_2_0
-                       bool havePage = Page != null;
-#endif
+                       Page page = Page;
+                       ClientScriptManager scriptManager = page != null ? page.ClientScript : null;
+                       
                        foreach (ListItem i in Items) {
-#if NET_2_0
-                               if (havePage)
-                                       Page.ClientScript.RegisterForEventValidation (UniqueID, i.Value);
+                               if (page != null)
+                                       scriptManager.RegisterForEventValidation (UniqueID, i.Value);
 
                                if (i.HasAttributes)
                                        i.Attributes.AddAttributes (writer);
-#endif
+
                                writer.RenderBeginTag (HtmlTextWriterTag.Li);
                                this.RenderBulletText (i, idx ++, writer);
                                writer.RenderEndTag ();
@@ -211,8 +215,8 @@ namespace System.Web.UI.WebControls {
                        this.OnClick (new BulletedListEventArgs (int.Parse (eventArgument, Helpers.InvariantCulture)));
                }
                        
-           [BrowsableAttribute (false)]
-       [EditorBrowsableAttribute (EditorBrowsableState.Never)]
+               [BrowsableAttribute (false)]
+               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
                public override bool AutoPostBack { 
                        get { return base.AutoPostBack; }
                        set { throw new NotSupportedException (String.Format ("This property is not supported in {0}", GetType ())); }
@@ -225,15 +229,14 @@ namespace System.Web.UI.WebControls {
                        set { throw new NotSupportedException (String.Format ("This property is not supported in {0}", GetType ())); }
                }
                
-           [EditorBrowsableAttribute (EditorBrowsableState.Never)]
+               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
                public override ListItem SelectedItem {
                        get { return null; }
                }
 
                [EditorBrowsable (EditorBrowsableState.Never)]
                [Bindable (false)]
-               public override string SelectedValue
-               {
+               public override string SelectedValue {
                        get { return string.Empty; }
                        set { throw new NotSupportedException (); }
                }
@@ -242,11 +245,11 @@ namespace System.Web.UI.WebControls {
                [EditorAttribute ("System.Web.UI.Design.ImageUrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
                [UrlPropertyAttribute]
                public virtual string BulletImageUrl {
-                       get { return ViewState.GetString ("BulletImageUrl", ""); }
+                       get { return ViewState.GetString ("BulletImageUrl", String.Empty); }
                        set { ViewState ["BulletImageUrl"] = value; }
                }
                
-           [DefaultValueAttribute (BulletStyle.NotSet)]
+               [DefaultValueAttribute (BulletStyle.NotSet)]
                public virtual BulletStyle BulletStyle {
                        get { return (BulletStyle) ViewState.GetInt ("BulletStyle", (int) BulletStyle.NotSet); }
                        set {
@@ -259,7 +262,7 @@ namespace System.Web.UI.WebControls {
                
                public override ControlCollection Controls { get { return new EmptyControlCollection (this); } }
                
-           [DefaultValueAttribute (BulletedListDisplayMode.Text)]
+               [DefaultValueAttribute (BulletedListDisplayMode.Text)]
                public virtual BulletedListDisplayMode DisplayMode {
                        get { return (BulletedListDisplayMode) ViewState.GetInt ("DisplayMode", (int)BulletedListDisplayMode.Text); }
                        set {
@@ -270,12 +273,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
                
-           [DefaultValueAttribute (1)]
+               [DefaultValueAttribute (1)]
                public virtual int FirstBulletNumber {
                        get { return ViewState.GetInt ("FirstBulletNumber", 1); }
                        set { ViewState ["FirstBulletNumber"] = value; }
                }
-               
 
                protected override HtmlTextWriterTag TagKey {
                        get {
@@ -306,24 +308,11 @@ namespace System.Web.UI.WebControls {
                }
 
                [EditorBrowsable (EditorBrowsableState.Never)]
-               public override string Text
-               {
-                       get { return string.Empty; }
+               public override string Text {
+                       get { return String.Empty; }
                        set { throw new NotSupportedException (); }
                }
                
-               
-               static readonly object ClickEvent = new object ();
-               public event BulletedListEventHandler Click
-               {
-                       add {
-                               Events.AddHandler (ClickEvent, value);
-                       }
-                       remove {
-                               Events.RemoveHandler (ClickEvent, value);
-                       }
-               }
-               
                protected virtual void OnClick (BulletedListEventArgs e)
                {
                        if (Events != null) {
@@ -334,4 +323,4 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
+
index 7f5d358342fed4e783304b078692dfadb8c5d369..a6901cf2755ff1ffc7de59a09aad605e07eaf930 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Jordi Mas i Hernandez (jordi@ximian.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -30,8 +30,8 @@ using System.ComponentModel;
 using System.ComponentModel.Design;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -40,18 +40,9 @@ namespace System.Web.UI.WebControls {
        [DataBindingHandler ("System.Web.UI.Design.TextDataBindingHandler, " + Consts.AssemblySystem_Design)]
        [DefaultProperty ("Text")]
        [Designer ("System.Web.UI.Design.WebControls.ButtonDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
-
-#if NET_2_0
        [ToolboxDataAttribute ("<{0}:Button runat=\"server\" Text=\"Button\"></{0}:Button>")]
        [SupportsEventValidation]
-#else
-       [ToolboxDataAttribute ("<{0}:Button runat=server Text=\"Button\"></{0}:Button>")]
-#endif
-
-       public class Button : WebControl, IPostBackEventHandler
-#if NET_2_0
-       , IButtonControl
-#endif
+       public class Button : WebControl, IPostBackEventHandler, IButtonControl
        {
                static readonly object ClickEvent = new object ();
                static readonly object CommandEvent = new object ();
@@ -60,113 +51,68 @@ namespace System.Web.UI.WebControls {
                {
                }
 
-#if ONLY_1_1
-               [Bindable (false)]
-#endif         
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
                [DefaultValue (true)]
-#if NET_2_0
                [Themeable (false)]
-               public virtual
-#else          
-               public
-#endif         
-               bool CausesValidation {
-                       get {
-                               return ViewState.GetBool ("CausesValidation", true);
-                       }
-
-                       set {
-                               ViewState ["CausesValidation"] = value;
-                       }
+               public virtual bool CausesValidation {
+                       get { return ViewState.GetBool ("CausesValidation", true); }
+                       set { ViewState ["CausesValidation"] = value; }
                }
 
                [DefaultValue ("")]
                [Bindable (true)]
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-#if NET_2_0
                [Themeable (false)]
-#endif         
                public string CommandArgument {
-                       get {
-                               return ViewState.GetString ("CommandArgument", "");
-                       }
-                       set {
-                               ViewState ["CommandArgument"] = value;
-                       }
+                       get { return ViewState.GetString ("CommandArgument", String.Empty); }
+                       set { ViewState ["CommandArgument"] = value; }
                }
 
                [DefaultValue ("")]
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-#if NET_2_0
                [Themeable (false)]
-#endif         
                public string CommandName {
-                       get {
-                               return ViewState.GetString ("CommandName", "");
-                       }
-                       set {
-                               ViewState ["CommandName"] = value;
-                       }
+                       get { return ViewState.GetString ("CommandName", String.Empty); }
+                       set { ViewState ["CommandName"] = value; }
                }
 
-#if NET_2_0
                [Themeable (false)]
                [DefaultValue ("")]
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Behavior")]
-               public virtual string OnClientClick 
-               {
-                       get {
-                               return ViewState.GetString ("OnClientClick", "");
-                       }
-                       set {
-                               ViewState ["OnClientClick"] = value;
-                       }
+               public virtual string OnClientClick {
+                       get { return ViewState.GetString ("OnClientClick", String.Empty); }
+                       set { ViewState ["OnClientClick"] = value; }
                }
 
-#endif         
-
                [DefaultValue ("")]
                [Bindable (true)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
-#if NET_2_0
                [Localizable (true)]
-#endif         
                public string Text {
-                       get {
-                               return ViewState.GetString ("Text", "");
-                       }
-                       set {
-                               ViewState ["Text"] = value;
-                       }
+                       get { return ViewState.GetString ("Text", String.Empty); }
+                       set { ViewState ["Text"] = value; }
                }
 
-#if NET_2_0
                [DefaultValue (true)]
                [Themeable (false)]
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Behavior")]
-               public virtual bool UseSubmitBehavior 
-               {
-                       get {
-                               return ViewState.GetBool ("UseSubmitBehavior", true);
-                       }
-                       set {
-                               ViewState ["UseSubmitBehavior"] = value;
-                       }
+               public virtual bool UseSubmitBehavior  {
+                       get { return ViewState.GetBool ("UseSubmitBehavior", true); }
+                       set { ViewState ["UseSubmitBehavior"] = value; }
                }
-#endif         
 
-               protected override void AddAttributesToRender (HtmlTextWriter writer) {
-                       if (Page != null)
-                               Page.VerifyRenderingInServerForm (this);
+               protected override void AddAttributesToRender (HtmlTextWriter writer)
+               {
+                       Page page = Page;
+                       if (page != null)
+                               page.VerifyRenderingInServerForm (this);
                        
-#if NET_2_0
                        writer.AddAttribute (HtmlTextWriterAttribute.Type, UseSubmitBehavior ? "submit" : "button", false);
                        writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
                        writer.AddAttribute (HtmlTextWriterAttribute.Value, Text);
@@ -178,39 +124,23 @@ namespace System.Web.UI.WebControls {
                                Attributes.Remove ("onclick");
                        }
 
-                       if (Page != null) {
+                       if (page != null)
                                onclick += GetClientScriptEventReference ();
-                       }
 
                        if (onclick.Length > 0)
                                writer.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick);
-#else
-                       writer.AddAttribute (HtmlTextWriterAttribute.Type, "submit");
-                       writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
-                       writer.AddAttribute (HtmlTextWriterAttribute.Value, Text);
-
-                       if (CausesValidation && Page != null && Page.AreValidatorsUplevel ()) {
-                               string onclick = Attributes["onclick"];
-                               if (onclick != null) {
-                                       Attributes.Remove("onclick");
-                                       int len = onclick.Length;
-                                       if (len > 0 && onclick[len - 1] != ';')
-                                               onclick += ";";
-                               }
-                               ClientScriptManager csm = new ClientScriptManager (Page);
-                               writer.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick + csm.GetClientValidationEvent ());
-                               writer.AddAttribute ("language", "javascript");
-                       }
-#endif
 
                        base.AddAttributesToRender (writer);
                }
 
-#if NET_2_0
                internal virtual string GetClientScriptEventReference ()
                {
                        PostBackOptions options = GetPostBackOptions ();
-                       return Page.ClientScript.GetPostBackEventReference (options, true);
+                       Page page = Page;
+                       if (page != null)
+                               return page.ClientScript.GetPostBackEventReference (options, true);
+                       else
+                               return String.Empty;
                }
 
                protected virtual PostBackOptions GetPostBackOptions () 
@@ -227,13 +157,14 @@ namespace System.Web.UI.WebControls {
                        options.Argument = String.Empty;
                        options.RequiresJavaScriptProtocol = false;
                        options.ClientSubmit = !UseSubmitBehavior;
-                       options.PerformValidation = CausesValidation && Page != null && Page.AreValidatorsUplevel (ValidationGroup);
+
+                       Page page = Page;
+                       options.PerformValidation = CausesValidation && page != null && page.AreValidatorsUplevel (ValidationGroup);
                        if (options.PerformValidation)
                                options.ValidationGroup = ValidationGroup;
 
                        return options;
                }
-#endif         
 
                void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
                {
@@ -260,78 +191,50 @@ namespace System.Web.UI.WebControls {
                        RaiseBubbleEvent (this, e);
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               void RaisePostBackEvent (string eventArgument)
+               protected virtual void RaisePostBackEvent (string eventArgument)
                {
-#if NET_2_0
                        ValidateEvent (UniqueID, eventArgument);
-#endif
-                       if (CausesValidation)
-#if NET_2_0
-                               Page.Validate (ValidationGroup);
-#else
-                               Page.Validate ();
-#endif
-
+                       if (CausesValidation) {
+                               Page page = Page;
+                               if (page != null)
+                                       page.Validate (ValidationGroup);
+                       }
+                       
                        OnClick (EventArgs.Empty);
                        OnCommand (new CommandEventArgs (CommandName, CommandArgument));
                }
 
-#if NET_2_0
                protected internal override void OnPreRender (EventArgs e)
                {
                        // Why override?
                        base.OnPreRender (e);
                }
-#endif
-               
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif
-               override void RenderContents (HtmlTextWriter writer)
+
+               protected internal override void RenderContents (HtmlTextWriter writer)
                 {
                 }
                
                [WebSysDescription ("")]
                [WebCategory ("Action")]
-               public event EventHandler Click
-               {
-                       add {
-                               Events.AddHandler (ClickEvent, value);
-                       }
-                       remove {
-                               Events.RemoveHandler (ClickEvent, value);
-                       }
+               public event EventHandler Click {
+                       add { Events.AddHandler (ClickEvent, value); }
+                       remove { Events.RemoveHandler (ClickEvent, value); }
                }
 
                [WebSysDescription ("")]
                [WebCategory ("Action")]
-               public event CommandEventHandler Command
-               {
-                       add {
-                               Events.AddHandler (CommandEvent, value);
-                       }
-                       remove {
-                               Events.RemoveHandler (CommandEvent, value);
-                       }
+               public event CommandEventHandler Command {
+                       add { Events.AddHandler (CommandEvent, value); }
+                       remove { Events.RemoveHandler (CommandEvent, value); }
                }
 
-#if NET_2_0
                [DefaultValue ("")]
                [Editor ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
                [Themeable (false)]
                [UrlProperty("*.aspx")]
                public virtual string PostBackUrl {
-                       get {
-                               return ViewState.GetString ("PostBackUrl", "");
-                       }
-                       set {
-                               ViewState ["PostBackUrl"] = value;
-                       }
+                       get { return ViewState.GetString ("PostBackUrl", String.Empty); }
+                       set { ViewState ["PostBackUrl"] = value; }
                }
 
                [DefaultValue ("")]
@@ -339,16 +242,8 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Behavior")]
                public virtual string ValidationGroup {
-                       get {
-                               return ViewState.GetString ("ValidationGroup", "");
-                       }
-                       set {
-                               ViewState ["ValidationGroup"] = value;
-                       }
-               }       
-#endif
-
+                       get { return ViewState.GetString ("ValidationGroup", String.Empty); }
+                       set { ViewState ["ValidationGroup"] = value; }
+               }
        }
 }
-
-
index 6174befa596e228d19d4ef875fb991080b4c9818..94d8ee9c046c88e1e78662c358c6f544dfc5041a 100644 (file)
@@ -5,7 +5,7 @@
 //      Dick Porter  <dick@ximian.com>
 //      Gonzalo Paniagua Javier (gonzalo@ximian.com)
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-       public class ButtonColumn : DataGridColumn {
-                      
+       public class ButtonColumn : DataGridColumn
+       {
+               string text_field;
+               string format;
+
                [DefaultValue(ButtonColumnType.LinkButton)]
-#if NET_2_0
                [WebSysDescription("The type of button contained within the column.")]
-#else
-               [Description("The type of button contained within the column.")]
-#endif
                [WebCategory ("Misc")]
-               public virtual ButtonColumnType ButtonType
-               {
+               public virtual ButtonColumnType ButtonType {
                        get {
                                return (ButtonColumnType) ViewState.GetInt ("LinkButton",
                                                (int) ButtonColumnType.LinkButton);
                        }
-                       set {
-                               ViewState ["LinkButton"] = value;
-                       }
+                       set { ViewState ["LinkButton"] = value; }
                }
                
                [DefaultValue("")]
-#if NET_2_0
                [WebSysDescription("The command associated with the button.")]
-#else
-               [Description("The command associated with the button.")]
-#endif
                [WebCategory ("Misc")]
-               public virtual string CommandName
-               {
-                       get {
-                               return ViewState.GetString ("CommandName", String.Empty);
-                       }
-                       set {
-                               ViewState ["CommandName"] = value;
-                       }
+               public virtual string CommandName {
+                       get { return ViewState.GetString ("CommandName", String.Empty); }
+                       set { ViewState ["CommandName"] = value; }
                }
 
-#if NET_2_0
                [DefaultValue (false)]
                [WebSysDescription("")]
                [WebCategory ("Behavior")]
-               public virtual bool CausesValidation
-               {
-                       get {
-                               return ViewState.GetBool ("CausesValidation", false);
-                       }
-                       set {
-                               ViewState ["CausesValidation"] = value;
-                       }
+               public virtual bool CausesValidation {
+                       get { return ViewState.GetBool ("CausesValidation", false); }
+                       set { ViewState ["CausesValidation"] = value; }
                }
-#endif
 
                [DefaultValue("")]
-#if NET_2_0
                [WebSysDescription("The field bound to the text property of the button.")]
-#else
-               [Description("The field bound to the text property of the button.")]
-#endif
                [WebCategory ("Misc")]
-               public virtual string DataTextField 
-               {
-                       get {
-                               return ViewState.GetString ("DataTextField", String.Empty);
-                       }
-                       set {
-                               ViewState ["DataTextField"] = value;
-                       }
+               public virtual string DataTextField {
+                       get { return ViewState.GetString ("DataTextField", String.Empty); }
+                       set { ViewState ["DataTextField"] = value; }
                }
                
                [DefaultValue("")]
-#if NET_2_0
                [WebSysDescription("The formatting applied to the value bound to the Text property.")]
-#else
-               [Description("The formatting applied to the value bound to the Text property.")]
-#endif
                [WebCategory ("Misc")]
-               public virtual string DataTextFormatString 
-               {
-                       get {
-                               return ViewState.GetString ("DataTextFormatString",
-                                               String.Empty);
-                       }
+               public virtual string DataTextFormatString {
+                       get { return ViewState.GetString ("DataTextFormatString", String.Empty); }
                        set {
                                ViewState ["DataTextFormatString"] = value;
                                format = null;
@@ -124,37 +87,21 @@ namespace System.Web.UI.WebControls {
                }
 
                [DefaultValue("")]
-#if NET_2_0
                [Localizable (true)]
                [WebSysDescription("The text used for the button.")]
-#else
-               [Description("The text used for the button.")]
-#endif
                [WebCategory ("Misc")]
-               public virtual string Text 
-               {
-                       get {
-                               return ViewState.GetString ("Text", String.Empty);
-                       }
-                       set {
-                               ViewState ["Text"] = value;
-                       }
+               public virtual string Text {
+                       get { return ViewState.GetString ("Text", String.Empty); }
+                       set { ViewState ["Text"] = value; }
                }
 
-#if NET_2_0
                [DefaultValue ("")]
                [WebSysDescription("")]
                [WebCategory ("Behavior")]
-               public virtual string ValidationGroup
-               {
-                       get {
-                               return ViewState.GetString ("ValidationGroup", "");
-                       }
-                       set {
-                               ViewState ["ValidationGroup"] = value;
-                       }
+               public virtual string ValidationGroup {
+                       get { return ViewState.GetString ("ValidationGroup", String.Empty); }
+                       set { ViewState ["ValidationGroup"] = value; }
                }
-#endif
                
                public override void Initialize ()
                {
@@ -164,54 +111,50 @@ namespace System.Web.UI.WebControls {
                        base.Initialize ();
                }
 
-               public override void InitializeCell (TableCell cell,
-                                                    int columnIndex,
-                                                    ListItemType itemType)
+               public override void InitializeCell (TableCell cell, int columnIndex, ListItemType itemType)
                {
                        base.InitializeCell (cell, columnIndex, itemType);
 
-                       if (itemType != ListItemType.Header &&
-                           itemType != ListItemType.Footer) {
+                       if (itemType != ListItemType.Header && itemType != ListItemType.Footer) {
                                switch (ButtonType) {
-                               case ButtonColumnType.LinkButton: 
-                               {
-                                       LinkButton butt = new ForeColorLinkButton ();
+                                       case ButtonColumnType.LinkButton: 
+                                       {
+                                               LinkButton butt = new ForeColorLinkButton ();
                                        
-                                       butt.Text = Text;
-                                       butt.CommandName = CommandName;
+                                               butt.Text = Text;
+                                               butt.CommandName = CommandName;
 
-                                       if (DataTextField != "")
-                                               butt.DataBinding += new EventHandler (DoDataBind);
+                                               if (!String.IsNullOrEmpty (DataTextField))
+                                                       butt.DataBinding += new EventHandler (DoDataBind);
 
-                                       cell.Controls.Add (butt);
-                               }
-                               break;
+                                               cell.Controls.Add (butt);
+                                       }
+                                       break;
 
-                               case ButtonColumnType.PushButton: 
-                               {
-                                       Button butt = new Button ();
+                                       case ButtonColumnType.PushButton: 
+                                       {
+                                               Button butt = new Button ();
                                        
-                                       butt.Text = Text;
-                                       butt.CommandName = CommandName;
-
-                                       if (DataTextField != "")
-                                               butt.DataBinding += new EventHandler (DoDataBind);
-                                       cell.Controls.Add (butt);
-                               }
-                               break;
+                                               butt.Text = Text;
+                                               butt.CommandName = CommandName;
+
+                                               if (!String.IsNullOrEmpty (DataTextField))
+                                                       butt.DataBinding += new EventHandler (DoDataBind);
+                                               cell.Controls.Add (butt);
+                                       }
+                                       break;
                        
                                }
                        }
                }
-
-               string text_field;
+               
                string GetValueFromItem (DataGridItem item)
                {
                        object val = null;
                        if (text_field == null)
                                text_field = DataTextField;
 
-                       if (text_field != "")
+                       if (!String.IsNullOrEmpty (text_field))
                                val = DataBinder.Eval (item.DataItem, text_field);
 
                        return FormatDataTextValue (val);
@@ -226,21 +169,19 @@ namespace System.Web.UI.WebControls {
                        if (lb == null) {
                                Button b = (Button) sender;
                                b.Text = text;
-                       } else {
+                       } else
                                lb.Text = text;
-                       }
                }
-
-               string format;
+               
                protected virtual string FormatDataTextValue (object dataTextValue)
                {
                        if (dataTextValue == null)
-                               return "";
+                               return String.Empty;
 
                        if (format == null)
                                format = DataTextFormatString;
 
-                       if (format == "")
+                       if (String.IsNullOrEmpty (format))
                                return dataTextValue.ToString ();
 
                        return String.Format (format, dataTextValue);
index 657ac2bcad5c2426fa3dcbbe602adbc7d14a0c4f..b18eeb933bbd7195b5d7cde4fede80db8ae4f466 100644 (file)
@@ -3,7 +3,7 @@
 //
 // Author: Duncan Mak (duncan@novell.com)
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 
 using System;
 
-namespace System.Web.UI.WebControls {
-
-#if !NET_2_0
-       [Serializable]
-#endif
+namespace System.Web.UI.WebControls
+{
        public enum ButtonColumnType
        {
                LinkButton,
index a451dd7468f693981fc2c2513cc5098604999294..30c1827bea938540395d32ffb49ae3757d91d961 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Reflection;
 using System.Collections;
 using System.Collections.Specialized;
@@ -36,8 +35,8 @@ using System.Web.UI;
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        public class ButtonField : ButtonFieldBase
@@ -48,7 +47,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("Raised when a Button Command is executed.")]
                [WebCategoryAttribute ("Behavior")]
                public virtual string CommandName {
-                       get { return ViewState.GetString ("CommandName", ""); }
+                       get { return ViewState.GetString ("CommandName", String.Empty); }
                        set {
                                ViewState ["CommandName"] = value;
                                OnFieldChanged ();
@@ -60,7 +59,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Data")]
                public virtual string DataTextField {
-                       get { return ViewState.GetString ("DataTextField", ""); }
+                       get { return ViewState.GetString ("DataTextField", String.Empty); }
                        set {
                                ViewState ["DataTextField"] = value;
                                OnFieldChanged ();
@@ -71,7 +70,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Data")]
                public virtual string DataTextFormatString {
-                       get { return ViewState.GetString ("DataTextFormatString", ""); }
+                       get { return ViewState.GetString ("DataTextFormatString", String.Empty); }
                        set {
                                ViewState ["DataTextFormatString"] = value;
                                OnFieldChanged ();
@@ -84,7 +83,7 @@ namespace System.Web.UI.WebControls {
                [DefaultValueAttribute ("")]
                [UrlPropertyAttribute]
                public virtual string ImageUrl {
-                       get { return ViewState.GetString ("ImageUrl", ""); }
+                       get { return ViewState.GetString ("ImageUrl", String.Empty); }
                        set {
                                ViewState ["ImageUrl"] = value;
                                OnFieldChanged ();
@@ -96,7 +95,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public virtual string Text {
-                       get { return ViewState.GetString ("Text", ""); }
+                       get { return ViewState.GetString ("Text", String.Empty); }
                        set {
                                ViewState ["Text"] = value;
                                OnFieldChanged ();
@@ -111,9 +110,9 @@ namespace System.Web.UI.WebControls {
                protected virtual string FormatDataTextValue (object value)
                {
                        if (DataTextFormatString.Length > 0)
-                               return string.Format (DataTextFormatString, value);
+                               return String.Format (DataTextFormatString, value);
                        else if (value == null)
-                               return string.Empty;
+                               return String.Empty;
                        else
                                return value.ToString ();
                }
@@ -132,13 +131,12 @@ namespace System.Web.UI.WebControls {
                                        btn.ValidationGroup = ValidationGroup;
                                }
                                
-                               if (DataTextField != "") {
+                               if (!String.IsNullOrEmpty (DataTextField)) {
                                        if ((rowState & DataControlRowState.Insert) == 0)
                                                cell.DataBinding += new EventHandler (OnDataBindField);
                                }
                                cell.Controls.Add ((Control) btn);
-                       }
-                       else
+                       } else
                                base.InitializeCell (cell, cellType, rowState, rowIndex);
                }
                
@@ -185,4 +183,3 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
index 9b8e3e318c1be5927ebb12a5f7e6ee872d955839..9db4f389feafa79943b374004fa08b7a183c5a35 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Web.UI;
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        public abstract class ButtonFieldBase : DataControlField
@@ -78,7 +77,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Behavior")]
                public virtual string ValidationGroup {
-                       get { return ViewState.GetString ("ValidationGroup", ""); }
+                       get { return ViewState.GetString ("ValidationGroup", String.Empty); }
                        set {
                                ViewState ["ValidationGroup"] = value;
                                OnFieldChanged ();
@@ -96,4 +95,3 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
index 480e29b3e5aff6714154511f4af1fd00f01f5e44..afcaa14fe77e64c2105e7e1274150b74b81011a5 100644 (file)
@@ -25,7 +25,6 @@
 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 
-#if NET_2_0
 namespace System.Web.UI.WebControls
 {
         public enum ButtonType
@@ -35,4 +34,4 @@ namespace System.Web.UI.WebControls
                 Link = 2,
         }
 }
-#endif
+
index 3f799e53446764e9331422549efebbc14066dcab..5744fad6e067b30ed0c9160b9fb750a22afff5f8 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //    Jordi Mas i Hernandez (jordi@ximian.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 //
 //
@@ -38,7 +38,8 @@ using System.Threading;
 using System.Text;
 using System.Web.Util;
 
-namespace System.Web.UI.WebControls {
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -47,10 +48,8 @@ namespace System.Web.UI.WebControls {
        [DefaultEvent("SelectionChanged")]
        [DefaultProperty("SelectedDate")]
        [Designer("System.Web.UI.Design.WebControls.CalendarDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
-#if NET_2_0
        [ControlValueProperty ("SelectedDate", "1/1/0001 12:00:00 AM")]
        [SupportsEventValidation]
-#endif         
        public class Calendar : WebControl, IPostBackEventHandler
        {
                TableItemStyle dayHeaderStyle;
@@ -76,45 +75,28 @@ namespace System.Web.UI.WebControls {
                {
                }
 
-#if NET_2_0
                [Localizable (true)]
                [DefaultValue ("")]
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
-               public virtual string Caption 
-               {
-                       get {
-                               return ViewState.GetString ("Caption", "");
-                       }
-                       set {
-                               ViewState["Caption"] = value;
-                       }
+               public virtual string Caption {
+                       get { return ViewState.GetString ("Caption", String.Empty); }
+                       set { ViewState["Caption"] = value; }
                }
 
                [DefaultValue (TableCaptionAlign.NotSet)]
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Accessibility")]
-               public virtual TableCaptionAlign CaptionAlign 
-               {
-                       get {
-                               return (TableCaptionAlign)ViewState.GetInt ("CaptionAlign", (int)TableCaptionAlign.NotSet);
-                       }
-                       set {
-                               ViewState ["CaptionAlign"] = value;
-                       }
+               public virtual TableCaptionAlign CaptionAlign {
+                       get { return (TableCaptionAlign)ViewState.GetInt ("CaptionAlign", (int)TableCaptionAlign.NotSet); }
+                       set { ViewState ["CaptionAlign"] = value; }
                }
-#endif
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(2)]
                [WebSysDescription ("")]
                [WebCategory ("Layout")]
                public int CellPadding {
-                       get {
-                               return ViewState.GetInt ("CellPadding", 2);
-                       }
+                       get { return ViewState.GetInt ("CellPadding", 2); }
 
                        set {
                                if (value < -1)
@@ -124,16 +106,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(0)]
                [WebSysDescription ("")]
                [WebCategory ("Layout")]
                public int CellSpacing {
-                       get {
-                               return ViewState.GetInt ("CellSpacing", 0);
-                       }
+                       get { return ViewState.GetInt ("CellSpacing", 0); }
 
                        set {
                                if (value < -1)
@@ -160,16 +137,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(DayNameFormat.Short)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public DayNameFormat DayNameFormat {
-                       get {
-                               return (DayNameFormat) ViewState.GetInt ("DayNameFormat", (int) DayNameFormat.Short);
-                       }
+                       get { return (DayNameFormat) ViewState.GetInt ("DayNameFormat", (int) DayNameFormat.Short); }
 
                        set {
                                if (value != DayNameFormat.FirstLetter && value != DayNameFormat.FirstTwoLetters &&
@@ -199,16 +171,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(FirstDayOfWeek.Default)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public FirstDayOfWeek FirstDayOfWeek {
-                       get {
-                               return (FirstDayOfWeek) ViewState.GetInt ("FirstDayOfWeek", (int) FirstDayOfWeek.Default);
-                       }
+                       get { return (FirstDayOfWeek) ViewState.GetInt ("FirstDayOfWeek", (int) FirstDayOfWeek.Default); }
 
                        set {
                                if (value < FirstDayOfWeek.Sunday || value > FirstDayOfWeek.Default) {
@@ -219,40 +186,24 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue("&gt;")]
-#if NET_2_0
                [Localizable (true)]
-#endif
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public string NextMonthText {
-                       get {
-                               return ViewState.GetString ("NextMonthText", "&gt;");
-                       }
-
-                       set {
-                               ViewState ["NextMonthText"] = value;
-                       }
+                       get { return ViewState.GetString ("NextMonthText", "&gt;"); }
+                       set { ViewState ["NextMonthText"] = value; }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(NextPrevFormat.CustomText)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public NextPrevFormat NextPrevFormat {
-                       get {
-                               return (NextPrevFormat) ViewState.GetInt ("NextPrevFormat", (int) NextPrevFormat.CustomText);
-                       }
+                       get { return (NextPrevFormat) ViewState.GetInt ("NextPrevFormat", (int) NextPrevFormat.CustomText); }
 
                        set {
-                               if (value != NextPrevFormat.CustomText && value != NextPrevFormat.ShortMonth && value != NextPrevFormat.FullMonth) {
+                               if (value != NextPrevFormat.CustomText && value != NextPrevFormat.ShortMonth && value != NextPrevFormat.FullMonth)
                                        throw new ArgumentOutOfRangeException ("The specified day name format is not one of the DayNameFormat values.");
-                               }
 
                                ViewState ["NextPrevFormat"] = value;
                        }
@@ -293,30 +244,16 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue("&lt;")]
-#if NET_2_0
                [Localizable (true)]
-#endif
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public string PrevMonthText {
-                       get {
-                               return ViewState.GetString ("PrevMonthText", "&lt;");
-                       }
-
-                       set {
-                               ViewState ["PrevMonthText"] = value;
-                       }
+                       get { return ViewState.GetString ("PrevMonthText", "&lt;"); }
+                       set { ViewState ["PrevMonthText"] = value; }
                }
 
-#if NET_2_0
                [Bindable(true, BindingDirection.TwoWay)]
-#else
-               [Bindable(true)]
-#endif         
                [DefaultValue("1/1/0001 12:00:00 AM")]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
@@ -328,9 +265,7 @@ namespace System.Web.UI.WebControls {
                                return DateTime.MinValue;
                        }
 
-                       set {
-                               SelectedDates.SelectRange (value, value);
-                       }
+                       set { SelectedDates.SelectRange (value, value); }
                }
 
                [Browsable(false)]
@@ -367,16 +302,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(CalendarSelectionMode.Day)]
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
                public CalendarSelectionMode SelectionMode {
-                       get {
-                               return (CalendarSelectionMode) ViewState.GetInt ("SelectionMode", (int) CalendarSelectionMode.Day);
-                       }
+                       get { return (CalendarSelectionMode) ViewState.GetInt ("SelectionMode", (int) CalendarSelectionMode.Day); }
 
                        set {
                                if (value != CalendarSelectionMode.Day  && value != CalendarSelectionMode.DayWeek &&
@@ -387,23 +317,13 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue("&gt;&gt;")]
-#if NET_2_0
                [Localizable (true)]
-#endif
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public string SelectMonthText {
-                       get {
-                               return ViewState.GetString ("SelectMonthText", "&gt;&gt;");
-                       }
-
-                       set {
-                               ViewState ["SelectMonthText"] = value;
-                       }
+                       get { return ViewState.GetString ("SelectMonthText", "&gt;&gt;"); }
+                       set { ViewState ["SelectMonthText"] = value; }
                }
 
                [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
@@ -423,99 +343,52 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue("&gt;")]
-#if NET_2_0            
                [Localizable (true)]
-#endif         
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public string SelectWeekText {
-                       get {
-                               return ViewState.GetString ("SelectWeekText", "&gt;");
-                       }
-
-                       set {
-                               ViewState ["SelectWeekText"] = value;
-                       }
+                       get { return ViewState.GetString ("SelectWeekText", "&gt;"); }
+                       set { ViewState ["SelectWeekText"] = value; }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(true)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public bool ShowDayHeader {
-                       get {
-                               return ViewState.GetBool ("ShowDayHeader", true);
-                       }
-
-                       set {
-                               ViewState ["ShowDayHeader"] = value;
-                       }
+                       get { return ViewState.GetBool ("ShowDayHeader", true); }
+                       set { ViewState ["ShowDayHeader"] = value; }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(false)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public bool ShowGridLines {
-                       get {
-                               return ViewState.GetBool ("ShowGridLines", false);
-                       }
-
-                       set {
-                               ViewState ["ShowGridLines"] = value;
-                       }
+                       get { return ViewState.GetBool ("ShowGridLines", false); }
+                       set { ViewState ["ShowGridLines"] = value; }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(true)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public bool ShowNextPrevMonth {
-                       get {
-                               return ViewState.GetBool ("ShowNextPrevMonth", true);
-                       }
-
-                       set {
-                               ViewState ["ShowNextPrevMonth"] = value;
-                       }
+                       get { return ViewState.GetBool ("ShowNextPrevMonth", true); }
+                       set { ViewState ["ShowNextPrevMonth"] = value; }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(true)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public bool ShowTitle {
-                       get {
-                               return ViewState.GetBool ("ShowTitle", true);
-                       }
-
-                       set {
-                               ViewState ["ShowTitle"] = value;
-                       }
+                       get { return ViewState.GetBool ("ShowTitle", true); }
+                       set { ViewState ["ShowTitle"] = value; }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(TitleFormat.MonthYear)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public TitleFormat TitleFormat {
-                       get {
-                               return (TitleFormat) ViewState.GetInt ("TitleFormat", (int) TitleFormat.MonthYear);
-                       }
+                       get { return (TitleFormat) ViewState.GetInt ("TitleFormat", (int) TitleFormat.MonthYear); }
 
                        set {
                                if (value != TitleFormat.Month && value != TitleFormat.MonthYear) {
@@ -561,9 +434,6 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [Browsable(false)]
                [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
                [WebSysDescription ("")]
@@ -578,25 +448,16 @@ namespace System.Web.UI.WebControls {
                                return today;
                        }
 
-                       set {
-                               ViewState ["TodaysDate"] = value.Date;
-                       }
+                       set { ViewState ["TodaysDate"] = value.Date; }
                }
 
-#if NET_2_0
                [DefaultValue (true)]
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Accessibility")]
-               public virtual bool UseAccessibleHeader 
-               {
-                       get {
-                               return ViewState.GetBool ("UseAccessibleHeader", true);
-                       }
-                       set {
-                               ViewState ["UseAccessibleHeader"] = value;
-                       }
+               public virtual bool UseAccessibleHeader  {
+                       get { return ViewState.GetBool ("UseAccessibleHeader", true); }
+                       set { ViewState ["UseAccessibleHeader"] = value; }
                }
-#endif         
 
                [Bindable(true)]
                [DefaultValue("1/1/0001 12:00:00 AM")]
@@ -612,9 +473,7 @@ namespace System.Web.UI.WebControls {
                                return DateTime.MinValue;
                        }
 
-                       set {
-                               ViewState ["VisibleDate"] = value.Date;
-                       }
+                       set { ViewState ["VisibleDate"] = value.Date; }
                }
 
                [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
@@ -677,20 +536,14 @@ namespace System.Web.UI.WebControls {
                        return false;
                }
                
-#if NET_2_0
                void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
                {
                        RaisePostBackEvent (eventArgument);
                }
 
                protected virtual void RaisePostBackEvent (string arg)
-#else
-               void IPostBackEventHandler.RaisePostBackEvent (string arg)
-#endif
                {
-#if NET_2_0
                        ValidateEvent (UniqueID, arg);
-#endif
                        if (arg.Length < 1)
                                return;
 
@@ -765,21 +618,16 @@ namespace System.Web.UI.WebControls {
                protected virtual void OnDayRender (TableCell cell, CalendarDay day)
                {
                        DayRenderEventHandler eh = (DayRenderEventHandler) (Events [DayRenderEvent]);
-                       if (eh != null)
-#if NET_2_0
-                               if (Page != null)
-                                       eh (this, new DayRenderEventArgs (cell, day, Page.ClientScript.GetPostBackClientHyperlink (this, GetDaysFromZenith (day.Date).ToString (), true)));
+                       if (eh != null) {
+                               Page page = Page;
+                               if (page != null)
+                                       eh (this, new DayRenderEventArgs (cell, day, page.ClientScript.GetPostBackClientHyperlink (this, GetDaysFromZenith (day.Date).ToString (), true)));
                                else
-#endif
-                               eh (this, new DayRenderEventArgs (cell, day));
+                                       eh (this, new DayRenderEventArgs (cell, day));
+                       }
                }
 
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void OnPreRender (EventArgs e)
+               protected internal override void OnPreRender (EventArgs e)
                {
                        base.OnPreRender (e);
                }
@@ -798,12 +646,7 @@ namespace System.Web.UI.WebControls {
                                eh (this, new MonthChangedEventArgs (newDate, previousDate));
                }
 
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void Render (HtmlTextWriter writer)
+               protected internal override void Render (HtmlTextWriter writer)
                {
                        TableStyle ts = new TableStyle ();
                        ts.CellSpacing = CellSpacing;
@@ -817,10 +660,9 @@ namespace System.Web.UI.WebControls {
                        writer.AddAttribute (HtmlTextWriterAttribute.Id, ClientID);
                        writer.RenderBeginTag (HtmlTextWriterTag.Table);
 
-#if NET_2_0
                        if (!String.IsNullOrEmpty (Caption))
                                WriteCaption (writer);
-#endif
+
                        bool enabled = IsEnabled;
                        
                        if (ShowTitle)
@@ -872,9 +714,8 @@ namespace System.Web.UI.WebControls {
                        states [0] = base.SaveViewState ();
 
                        for (int i = 0; i < states.Length; i++) {
-                               if (states [i] != null) {
+                               if (states [i] != null)
                                        return states;
-                               }
                        }
 
                        return null;
@@ -953,14 +794,11 @@ namespace System.Web.UI.WebControls {
                                DayOfWeek dayOfWeek = (DayOfWeek) i;
                                dayName = dti.GetDayName (dayOfWeek);
 
-#if NET_2_0
                                if (UseAccessibleHeader) {
                                        writer.AddAttribute (HtmlTextWriterAttribute.Abbr, dayName);
                                        writer.AddAttribute (HtmlTextWriterAttribute.Scope, "col", false);
                                        cell = new TableHeaderCell();
-                               }
-                               else
-#endif
+                               } else
                                        cell = new TableCell();
 
                                cell.HorizontalAlign = HorizontalAlign.Center;
@@ -969,34 +807,31 @@ namespace System.Web.UI.WebControls {
                                cell.RenderBeginTag (writer);
 
                                switch (DayNameFormat) {
-                               case DayNameFormat.FirstLetter:
-                                       dayName = dayName.Substring (0, 1);
-                                       break;
-                               case DayNameFormat.FirstTwoLetters:
-                                       dayName = dayName.Substring (0, 2);
-                                       break;
-#if NET_2_0
-                               case DayNameFormat.Shortest:
-                                       dayName = dti.GetShortestDayName (dayOfWeek);
-                                       break;
-#endif
-                               case DayNameFormat.Full:
-                                       break;
-                               case DayNameFormat.Short:
-                               default:
-                                       dayName = dti.GetAbbreviatedDayName (dayOfWeek);
-                                       break;
+                                       case DayNameFormat.FirstLetter:
+                                               dayName = dayName.Substring (0, 1);
+                                               break;
+                                       case DayNameFormat.FirstTwoLetters:
+                                               dayName = dayName.Substring (0, 2);
+                                               break;
+                                       case DayNameFormat.Shortest:
+                                               dayName = dti.GetShortestDayName (dayOfWeek);
+                                               break;
+                                       case DayNameFormat.Full:
+                                               break;
+                                       case DayNameFormat.Short:
+                                       default:
+                                               dayName = dti.GetAbbreviatedDayName (dayOfWeek);
+                                               break;
                                }
 
                                writer.Write (dayName);
                                cell.RenderEndTag (writer);
 
-                               if (i >= daysInAWeek - 1) {
+                               if (i >= daysInAWeek - 1)
                                        i = 0;
-                               }
-                               else {
+                               else
                                        i++;
-                               }
+                               
                                if (i == first)
                                        break;
                        }
@@ -1024,28 +859,23 @@ namespace System.Web.UI.WebControls {
 
                        OnDayRender (cell, day);
                                        
-                       if (dayStyle != null && !dayStyle.IsEmpty) {
+                       if (dayStyle != null && !dayStyle.IsEmpty)
                                style.CopyFrom (dayStyle);
-                       }
 
-                       if (day.IsWeekend && weekendDayStyle != null && !weekendDayStyle.IsEmpty) {
+                       if (day.IsWeekend && weekendDayStyle != null && !weekendDayStyle.IsEmpty)
                                style.CopyFrom (weekendDayStyle);
-                       }
 
-                       if (day.IsToday && todayDayStyle != null && !todayDayStyle.IsEmpty) {
+                       if (day.IsToday && todayDayStyle != null && !todayDayStyle.IsEmpty)
                                style.CopyFrom (todayDayStyle);
-                       }
 
-                       if (day.IsOtherMonth && otherMonthDayStyle != null && !otherMonthDayStyle.IsEmpty) {
+                       if (day.IsOtherMonth && otherMonthDayStyle != null && !otherMonthDayStyle.IsEmpty)
                                style.CopyFrom (otherMonthDayStyle);
-                       }
 
                        if (enabled && day.IsSelected) {
                                style.BackColor = Color.Silver;
                                style.ForeColor = Color.White;
-                               if (selectedDayStyle != null && !selectedDayStyle.IsEmpty) {
+                               if (selectedDayStyle != null && !selectedDayStyle.IsEmpty)
                                        style.CopyFrom (selectedDayStyle);
-                               }
                        }
 
                        cell.ApplyStyle (style);
@@ -1107,21 +937,18 @@ namespace System.Web.UI.WebControls {
                {
                        StringBuilder str = new StringBuilder ();
                        Color clr;
-                       hasLink = (Page != null && hasLink == true) ? true : false;
+                       Page page = Page;
+                       hasLink = (page != null && hasLink == true) ? true : false;
 
                        if (hasLink) {
                                str.Append ("<a href=\"");
-#if NET_2_0
-                               str.Append (Page.ClientScript.GetPostBackClientHyperlink (this, arg, true));
-#else
-                               str.Append (Page.ClientScript.GetPostBackClientHyperlink (this, arg));
-#endif                 
+                               str.Append (page.ClientScript.GetPostBackClientHyperlink (this, arg, true));
                                str.Append ('\"');
                        
 
-                               if (!foreColor.IsEmpty) {
+                               if (!foreColor.IsEmpty)
                                        clr = foreColor;
-                               else {
+                               else {
                                        if (ForeColor.IsEmpty)
                                                clr = Color.Black;
                                        else
@@ -1132,8 +959,7 @@ namespace System.Web.UI.WebControls {
                                str.Append ("\">");
                                str.Append (text);
                                str.Append ("</a>");
-                       }
-                       else 
+                       } else 
                                str.Append (text);
 
                        return str.ToString ();
@@ -1145,7 +971,6 @@ namespace System.Web.UI.WebControls {
                        return span.Days;
                }
 
-#if NET_2_0
                void WriteCaption (HtmlTextWriter writer)
                {
                        if (CaptionAlign != TableCaptionAlign.NotSet)
@@ -1155,7 +980,6 @@ namespace System.Web.UI.WebControls {
                        writer.Write (Caption);
                        writer.RenderEndTag ();
                }
-#endif
 
                void WriteTitle (HtmlTextWriter writer, bool enabled)
                {
@@ -1167,19 +991,17 @@ namespace System.Web.UI.WebControls {
 
                        titleCell.ColumnSpan = HasWeekSelectors (SelectionMode) ? 8 : 7;
 
-                       if (titleStyle != null && !titleStyle.IsEmpty && !titleStyle.BackColor.IsEmpty) {
+                       if (titleStyle != null && !titleStyle.IsEmpty && !titleStyle.BackColor.IsEmpty)
                                titleCell.BackColor = titleStyle.BackColor;
-                       } else {
+                       else
                                titleCell.BackColor = Color.Silver;
-                       }
 
                        titleCell.RenderBeginTag (writer);
 
                        // Table
                        tableTitle.Width =  Unit.Percentage (100);
-                       if (titleStyle != null && !titleStyle.IsEmpty) {
+                       if (titleStyle != null && !titleStyle.IsEmpty)
                                tableTitle.ApplyStyle (titleStyle);
-                       }
 
                        tableTitle.RenderBeginTag (writer);
                        writer.RenderBeginTag (HtmlTextWriterTag.Tr);
@@ -1229,10 +1051,8 @@ namespace System.Web.UI.WebControls {
                        tableTitle.RenderEndTag (writer);
                        titleCell.RenderEndTag (writer);
                        writer.RenderEndTag (); //tr
-
                }
 
-
                string GetNextPrevFormatText (DateTime date, bool next)
                {
                        string text;
@@ -1271,35 +1091,22 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategory ("Action")]
                public event DayRenderEventHandler DayRender {
-                       add {
-                               Events.AddHandler (DayRenderEvent, value);
-                       }
-                       remove {
-                               Events.RemoveHandler (DayRenderEvent, value);
-                       }
+                       add { Events.AddHandler (DayRenderEvent, value); }
+                       remove { Events.RemoveHandler (DayRenderEvent, value); }
                }
 
                [WebSysDescription ("")]
                [WebCategory ("Action")]
                public event EventHandler SelectionChanged {
-                       add {
-                               Events.AddHandler (SelectionChangedEvent, value);
-                       }
-                       remove {
-                               Events.RemoveHandler (SelectionChangedEvent, value);
-                       }
+                       add { Events.AddHandler (SelectionChangedEvent, value); }
+                       remove { Events.RemoveHandler (SelectionChangedEvent, value); }
                }
 
                [WebSysDescription ("")]
                [WebCategory ("Action")]
                public event MonthChangedEventHandler VisibleMonthChanged {
-                       add {
-                               Events.AddHandler (VisibleMonthChangedEvent, value);
-                       }
-                       remove {
-                               Events.RemoveHandler (VisibleMonthChangedEvent, value);
-                       }
+                       add { Events.AddHandler (VisibleMonthChangedEvent, value); }
+                       remove { Events.RemoveHandler (VisibleMonthChangedEvent, value); }
                }
        }
 }
-
index c847104beca08b0e9011f82757b5fab283c60a2b..3820c52ee9c01b65101d44d0c63c8996b1ddb456 100644 (file)
@@ -4,7 +4,7 @@
 // Author:
 //      Jordi Mas i Hernandez  <jordi@ximian.com>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace System.Web.UI.WebControls {
-
-#if !NET_2_0
-       [Serializable]
-#endif
-       public enum CalendarSelectionMode {
+namespace System.Web.UI.WebControls
+{
+       public enum CalendarSelectionMode
+       {
                None,
                Day,
                DayWeek,
index 5d29f05fcd2544273bfb7217697763bc49204652..ff6890e1b23a1a96f1e49915dff32cc54aa7dc47 100644 (file)
@@ -27,8 +27,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Web.Security;
 using System.Collections.Generic;
@@ -125,11 +123,9 @@ namespace System.Web.UI.WebControls
                #region Public Properties
 
                [DefaultValue (1)]
-               public virtual int BorderPadding
-               {
+               public virtual int BorderPadding {
                        get { return ViewState.GetInt ("BorderPadding", 1); }
-                       set
-                       {
+                       set {
                                if (value < -1)
                                        throw new ArgumentOutOfRangeException ();
                                ViewState ["BorderPadding"] = value;
@@ -137,8 +133,7 @@ namespace System.Web.UI.WebControls
                }
 
                [DefaultValue ("")]
-               public virtual string CancelButtonImageUrl
-               {
+               public virtual string CancelButtonImageUrl {
                        get { return ViewState.GetString ("CancelButtonImageUrl", String.Empty); }
                        set { ViewState ["CancelButtonImageUrl"] = value; }
                }
@@ -146,10 +141,8 @@ namespace System.Web.UI.WebControls
                [PersistenceMode (PersistenceMode.InnerProperty)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                [NotifyParentProperty (true)]
-               public Style CancelButtonStyle
-               {
-                       get
-                       {
+               public Style CancelButtonStyle {
+                       get {
                                if (_cancelButtonStyle == null) {
                                        _cancelButtonStyle = new Style ();
                                        if (IsTrackingViewState)
@@ -160,27 +153,23 @@ namespace System.Web.UI.WebControls
                }
 
                [Localizable (true)]
-               public virtual string CancelButtonText
-               {
+               public virtual string CancelButtonText {
                        get { return ViewState.GetString ("CancelButtonText", "Cancel"); }
                        set { ViewState ["CancelButtonText"] = value; }
                }
 
-               public virtual ButtonType CancelButtonType
-               {
+               public virtual ButtonType CancelButtonType {
                        get { return ViewState ["CancelButtonType"] == null ? ButtonType.Button : (ButtonType) ViewState ["CancelButtonType"]; }
                        set { ViewState ["CancelButtonType"] = value; }
                }
 
                [Themeable (false)]
-               public virtual string CancelDestinationPageUrl
-               {
+               public virtual string CancelDestinationPageUrl {
                        get { return ViewState.GetString ("CancelDestinationPageUrl", String.Empty); }
                        set { ViewState ["CancelDestinationPageUrl"] = value; }
                }
 
-               public virtual string ChangePasswordButtonImageUrl
-               {
+               public virtual string ChangePasswordButtonImageUrl {
                        get { return ViewState.GetString ("ChangePasswordButtonImageUrl", String.Empty); }
                        set { ViewState ["ChangePasswordButtonImageUrl"] = value; }
                }
@@ -189,10 +178,8 @@ namespace System.Web.UI.WebControls
                [PersistenceMode (PersistenceMode.InnerProperty)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                [NotifyParentProperty (true)]
-               public Style ChangePasswordButtonStyle
-               {
-                       get
-                       {
+               public Style ChangePasswordButtonStyle {
+                       get {
                                if (_changePasswordButtonStyle == null) {
                                        _changePasswordButtonStyle = new Style ();
                                        if (IsTrackingViewState)
@@ -203,21 +190,18 @@ namespace System.Web.UI.WebControls
                }
 
                [Localizable (true)]
-               public virtual string ChangePasswordButtonText
-               {
+               public virtual string ChangePasswordButtonText {
                        get { return ViewState.GetString ("ChangePasswordButtonText", "Change Password"); }
                        set { ViewState ["ChangePasswordButtonText"] = value; }
                }
 
-               public virtual ButtonType ChangePasswordButtonType
-               {
+               public virtual ButtonType ChangePasswordButtonType {
                        get { return ViewState ["ChangePasswordButtonType"] == null ? ButtonType.Button : (ButtonType) ViewState ["ChangePasswordButtonType"]; }
                        set { ViewState ["ChangePasswordButtonType"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string ChangePasswordFailureText
-               {
+               public virtual string ChangePasswordFailureText {
                        get { return ViewState.GetString ("ChangePasswordFailureText", "Your attempt to change passwords was unsuccessful. Please try again."); }
                        set { ViewState ["ChangePasswordFailureText"] = value; }
                }
@@ -225,18 +209,15 @@ namespace System.Web.UI.WebControls
                [Browsable (false)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
                [TemplateContainer (typeof (ChangePassword))]
-               public virtual ITemplate ChangePasswordTemplate
-               {
+               public virtual ITemplate ChangePasswordTemplate {
                        get { return _changePasswordTemplate; }
                        set { _changePasswordTemplate = value; }
                }
 
                [Browsable (false)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public Control ChangePasswordTemplateContainer
-               {
-                       get
-                       {
+               public Control ChangePasswordTemplateContainer {
+                       get {
                                if (_changePasswordTemplateContainer == null)
                                        _changePasswordTemplateContainer = new ChangePasswordContainer (this);
                                return _changePasswordTemplateContainer;
@@ -244,8 +225,7 @@ namespace System.Web.UI.WebControls
                }
 
                [Localizable (true)]
-               public virtual string ChangePasswordTitleText
-               {
+               public virtual string ChangePasswordTitleText {
                        get { return ViewState.GetString ("ChangePasswordTitleText", "Change Your Password"); }
                        set { ViewState ["ChangePasswordTitleText"] = value; }
                }
@@ -254,34 +234,29 @@ namespace System.Web.UI.WebControls
                [Browsable (false)]
                [Themeable (false)]
                [Filterable (false)]
-               public virtual string ConfirmNewPassword
-               {
-                       get { return _newPasswordConfirm != null ? _newPasswordConfirm : ""; }
+               public virtual string ConfirmNewPassword {
+                       get { return _newPasswordConfirm != null ? _newPasswordConfirm : String.Empty; }
                }
 
                [Localizable (true)]
-               public virtual string ConfirmNewPasswordLabelText
-               {
+               public virtual string ConfirmNewPasswordLabelText {
                        get { return ViewState.GetString ("ConfirmNewPasswordLabelText", "Confirm New Password:"); }
                        set { ViewState ["ConfirmNewPasswordLabelText"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string ConfirmPasswordCompareErrorMessage
-               {
+               public virtual string ConfirmPasswordCompareErrorMessage {
                        get { return ViewState.GetString ("ConfirmPasswordCompareErrorMessage", "The Confirm New Password must match the New Password entry."); }
                        set { ViewState ["ConfirmPasswordCompareErrorMessage"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string ConfirmPasswordRequiredErrorMessage
-               {
+               public virtual string ConfirmPasswordRequiredErrorMessage {
                        get { return ViewState.GetString ("ConfirmPasswordRequiredErrorMessage", String.Empty); }
                        set { ViewState ["ConfirmPasswordRequiredErrorMessage"] = value; }
                }
 
-               public virtual string ContinueButtonImageUrl
-               {
+               public virtual string ContinueButtonImageUrl {
                        get { return ViewState.GetString ("ContinueButtonImageUrl", String.Empty); }
                        set { ViewState ["ContinueButtonImageUrl"] = value; }
                }
@@ -289,10 +264,8 @@ namespace System.Web.UI.WebControls
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
-               public Style ContinueButtonStyle
-               {
-                       get
-                       {
+               public Style ContinueButtonStyle {
+                       get {
                                if (_continueButtonStyle == null) {
                                        _continueButtonStyle = new Style ();
                                        if (IsTrackingViewState)
@@ -303,40 +276,34 @@ namespace System.Web.UI.WebControls
                }
 
                [Localizable (true)]
-               public virtual string ContinueButtonText
-               {
+               public virtual string ContinueButtonText {
                        get { return ViewState.GetString ("ContinueButtonText", "Continue"); }
                        set { ViewState ["ContinueButtonText"] = value; }
                }
 
-               public virtual ButtonType ContinueButtonType
-               {
+               public virtual ButtonType ContinueButtonType {
                        get { return ViewState ["ContinueButtonType"] == null ? ButtonType.Button : (ButtonType) ViewState ["ContinueButtonType"]; }
                        set { ViewState ["ContinueButtonType"] = value; }
                }
 
                [Themeable (false)]
-               public virtual string ContinueDestinationPageUrl
-               {
+               public virtual string ContinueDestinationPageUrl {
                        get { return ViewState.GetString ("ContinueDestinationPageUrl", String.Empty); }
                        set { ViewState ["ContinueDestinationPageUrl"] = value; }
                }
 
-               public virtual string CreateUserIconUrl
-               {
+               public virtual string CreateUserIconUrl {
                        get { return ViewState.GetString ("CreateUserIconUrl", String.Empty); }
                        set { ViewState ["CreateUserIconUrl"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string CreateUserText
-               {
+               public virtual string CreateUserText {
                        get { return ViewState.GetString ("CreateUserText", String.Empty); }
                        set { ViewState ["CreateUserText"] = value; }
                }
 
-               public virtual string CreateUserUrl
-               {
+               public virtual string CreateUserUrl {
                        get { return ViewState.GetString ("CreateUserUrl", String.Empty); }
                        set { ViewState ["CreateUserUrl"] = value; }
                }
@@ -344,33 +311,28 @@ namespace System.Web.UI.WebControls
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [Browsable (false)]
                [Themeable (false)]
-               public virtual string CurrentPassword
-               {
-                       get { return _currentPassword != null ? _currentPassword : ""; }
+               public virtual string CurrentPassword {
+                       get { return _currentPassword != null ? _currentPassword : String.Empty; }
                }
 
                [DefaultValue (false)]
-               public virtual bool DisplayUserName
-               {
+               public virtual bool DisplayUserName {
                        get { return ViewState.GetBool ("DisplayUserName", false); }
                        set { ViewState ["DisplayUserName"] = value; }
                }
 
-               public virtual string EditProfileIconUrl
-               {
+               public virtual string EditProfileIconUrl {
                        get { return ViewState.GetString ("EditProfileIconUrl", String.Empty); }
                        set { ViewState ["EditProfileIconUrl"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string EditProfileText
-               {
+               public virtual string EditProfileText {
                        get { return ViewState.GetString ("EditProfileText", String.Empty); }
                        set { ViewState ["EditProfileText"] = value; }
                }
 
-               public virtual string EditProfileUrl
-               {
+               public virtual string EditProfileUrl {
                        get { return ViewState.GetString ("EditProfileUrl", String.Empty); }
                        set { ViewState ["EditProfileUrl"] = value; }
                }
@@ -378,10 +340,8 @@ namespace System.Web.UI.WebControls
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
-               public TableItemStyle FailureTextStyle
-               {
-                       get
-                       {
+               public TableItemStyle FailureTextStyle {
+                       get {
                                if (_failureTextStyle == null) {
                                        _failureTextStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -391,21 +351,18 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string HelpPageIconUrl
-               {
+               public virtual string HelpPageIconUrl {
                        get { return ViewState.GetString ("HelpPageIconUrl", String.Empty); }
                        set { ViewState ["HelpPageIconUrl"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string HelpPageText
-               {
+               public virtual string HelpPageText {
                        get { return ViewState.GetString ("HelpPageText", String.Empty); }
                        set { ViewState ["HelpPageText"] = value; }
                }
 
-               public virtual string HelpPageUrl
-               {
+               public virtual string HelpPageUrl {
                        get { return ViewState.GetString ("HelpPageUrl", String.Empty); }
                        set { ViewState ["HelpPageUrl"] = value; }
                }
@@ -413,10 +370,8 @@ namespace System.Web.UI.WebControls
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
-               public TableItemStyle HyperLinkStyle
-               {
-                       get
-                       {
+               public TableItemStyle HyperLinkStyle {
+                       get {
                                if (_hyperLinkStyle == null) {
                                        _hyperLinkStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -427,8 +382,7 @@ namespace System.Web.UI.WebControls
                }
 
                [Localizable (true)]
-               public virtual string InstructionText
-               {
+               public virtual string InstructionText {
                        get { return ViewState.GetString ("InstructionText", String.Empty); }
                        set { ViewState ["InstructionText"] = value; }
                }
@@ -436,10 +390,8 @@ namespace System.Web.UI.WebControls
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
-               public TableItemStyle InstructionTextStyle
-               {
-                       get
-                       {
+               public TableItemStyle InstructionTextStyle {
+                       get {
                                if (_instructionTextStyle == null) {
                                        _instructionTextStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -452,10 +404,8 @@ namespace System.Web.UI.WebControls
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
-               public TableItemStyle LabelStyle
-               {
-                       get
-                       {
+               public TableItemStyle LabelStyle {
+                       get {
                                if (_labelStyle == null) {
                                        _labelStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -469,10 +419,8 @@ namespace System.Web.UI.WebControls
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
-               public MailDefinition MailDefinition
-               {
-                       get
-                       {
+               public MailDefinition MailDefinition {
+                       get {
                                if (_mailDefinition == null) {
                                        _mailDefinition = new MailDefinition ();
                                        if (IsTrackingViewState)
@@ -484,15 +432,13 @@ namespace System.Web.UI.WebControls
 
                [Themeable (false)]
                [DefaultValue ("")]
-               public virtual string MembershipProvider
-               {
-                       get
-                       {
+               public virtual string MembershipProvider {
+                       get {
                                object o = ViewState ["MembershipProvider"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       
+                       set {
                                if (value == null)
                                        ViewState.Remove ("MembershipProvider");
                                else
@@ -504,33 +450,28 @@ namespace System.Web.UI.WebControls
 
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [Themeable (false)]
-               public virtual string NewPassword
-               {
-                       get { return _newPassword != null ? _newPassword : ""; }
+               public virtual string NewPassword {
+                       get { return _newPassword != null ? _newPassword : String.Empty; }
                }
 
                [Localizable (true)]
-               public virtual string NewPasswordLabelText
-               {
+               public virtual string NewPasswordLabelText {
                        get { return ViewState.GetString ("NewPasswordLabelText", "New Password:"); }
                        set { ViewState ["NewPasswordLabelText"] = value; }
                }
 
-               public virtual string NewPasswordRegularExpression
-               {
+               public virtual string NewPasswordRegularExpression {
                        get { return ViewState.GetString ("NewPasswordRegularExpression", String.Empty); }
                        set { ViewState ["NewPasswordRegularExpression"] = value; }
                }
 
-               public virtual string NewPasswordRegularExpressionErrorMessage
-               {
+               public virtual string NewPasswordRegularExpressionErrorMessage {
                        get { return ViewState.GetString ("NewPasswordRegularExpressionErrorMessage", String.Empty); }
                        set { ViewState ["NewPasswordRegularExpressionErrorMessage"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string NewPasswordRequiredErrorMessage
-               {
+               public virtual string NewPasswordRequiredErrorMessage {
                        get { return ViewState.GetString ("NewPasswordRequiredErrorMessage", "New Password is required."); }
                        set { ViewState ["NewPasswordRequiredErrorMessage"] = value; }
                }
@@ -538,10 +479,8 @@ namespace System.Web.UI.WebControls
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
-               public TableItemStyle PasswordHintStyle
-               {
-                       get
-                       {
+               public TableItemStyle PasswordHintStyle {
+                       get {
                                if (_passwordHintStyle == null) {
                                        _passwordHintStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -552,48 +491,41 @@ namespace System.Web.UI.WebControls
                }
 
                [Localizable (true)]
-               public virtual string PasswordHintText
-               {
+               public virtual string PasswordHintText {
                        get { return ViewState.GetString ("PasswordHintText", String.Empty); }
                        set { ViewState ["PasswordHintText"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string PasswordLabelText
-               {
+               public virtual string PasswordLabelText {
                        get { return ViewState.GetString ("PasswordLabelText", "Password:"); }
                        set { ViewState ["PasswordLabelText"] = value; }
                }
 
-               public virtual string PasswordRecoveryIconUrl
-               {
+               public virtual string PasswordRecoveryIconUrl {
                        get { return ViewState.GetString ("PasswordRecoveryIconUrl", String.Empty); }
                        set { ViewState ["PasswordRecoveryIconUrl"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string PasswordRecoveryText
-               {
+               public virtual string PasswordRecoveryText {
                        get { return ViewState.GetString ("PasswordRecoveryText", String.Empty); }
                        set { ViewState ["PasswordRecoveryText"] = value; }
                }
 
-               public virtual string PasswordRecoveryUrl
-               {
+               public virtual string PasswordRecoveryUrl {
                        get { return ViewState.GetString ("PasswordRecoveryUrl", String.Empty); }
                        set { ViewState ["PasswordRecoveryUrl"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string PasswordRequiredErrorMessage
-               {
+               public virtual string PasswordRequiredErrorMessage {
                        get { return ViewState.GetString ("PasswordRequiredErrorMessage", String.Empty); }
                        set { ViewState ["PasswordRequiredErrorMessage"] = value; }
                }
 
                [Themeable (false)]
-               public virtual string SuccessPageUrl
-               {
+               public virtual string SuccessPageUrl {
                        get { return ViewState.GetString ("SuccessPageUrl", String.Empty); }
                        set { ViewState ["SuccessPageUrl"] = value; }
                }
@@ -601,18 +533,15 @@ namespace System.Web.UI.WebControls
                [PersistenceMode (PersistenceMode.InnerProperty)]
                [TemplateContainer (typeof (ChangePassword))]
                [Browsable (false)]
-               public virtual ITemplate SuccessTemplate
-               {
+               public virtual ITemplate SuccessTemplate {
                        get { return _successTemplate; }
                        set { _successTemplate = value; }
                }
 
                [Browsable (false)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public Control SuccessTemplateContainer
-               {
-                       get
-                       {
+               public Control SuccessTemplateContainer {
+                       get {
                                if (_successTemplateContainer == null)
                                        _successTemplateContainer = new SuccessContainer (this);
                                return _successTemplateContainer;
@@ -621,8 +550,7 @@ namespace System.Web.UI.WebControls
                }
 
                [Localizable (true)]
-               public virtual string SuccessText
-               {
+               public virtual string SuccessText {
                        get { return ViewState.GetString ("SuccessText", "Your password has been changed!"); }
                        set { ViewState ["SuccessText"] = value; }
                }
@@ -630,10 +558,8 @@ namespace System.Web.UI.WebControls
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-               public TableItemStyle SuccessTextStyle
-               {
-                       get
-                       {
+               public TableItemStyle SuccessTextStyle {
+                       get {
                                if (_successTextStyle == null) {
                                        _successTextStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -644,8 +570,7 @@ namespace System.Web.UI.WebControls
                }
 
                [Localizable (true)]
-               public virtual string SuccessTitleText
-               {
+               public virtual string SuccessTitleText {
                        get { return ViewState.GetString ("SuccessTitleText", "Change Password Complete"); }
                        set { ViewState ["SuccessTitleText"] = value; }
                }
@@ -653,10 +578,8 @@ namespace System.Web.UI.WebControls
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-               public Style TextBoxStyle
-               {
-                       get
-                       {
+               public Style TextBoxStyle {
+                       get {
                                if (_textBoxStyle == null) {
                                        _textBoxStyle = new Style ();
                                        if (IsTrackingViewState)
@@ -669,10 +592,8 @@ namespace System.Web.UI.WebControls
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-               public TableItemStyle TitleTextStyle
-               {
-                       get
-                       {
+               public TableItemStyle TitleTextStyle {
+                       get {
                                if (_titleTextStyle == null) {
                                        _titleTextStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -683,28 +604,24 @@ namespace System.Web.UI.WebControls
                }
 
                [DefaultValue ("")]
-               public virtual string UserName
-               {
-                       get
-                       {
+               public virtual string UserName {
+                       get {
                                if (_username == null && HttpContext.Current.Request.IsAuthenticated)
                                        _username = HttpContext.Current.User.Identity.Name;
 
-                               return _username != null ? _username : "";
+                               return _username != null ? _username : String.Empty;
                        }
                        set { _username = value; }
                }
 
                [Localizable (true)]
-               public virtual string UserNameLabelText
-               {
+               public virtual string UserNameLabelText {
                        get { return ViewState.GetString ("UserNameLabelText", "User Name:"); }
                        set { ViewState ["UserNameLabelText"] = value; }
                }
 
                [Localizable (true)]
-               public virtual string UserNameRequiredErrorMessage
-               {
+               public virtual string UserNameRequiredErrorMessage {
                        get { return ViewState.GetString ("UserNameRequiredErrorMessage", "User Name is required."); }
                        set { ViewState ["UserNameRequiredErrorMessage"] = value; }
                }
@@ -712,10 +629,8 @@ namespace System.Web.UI.WebControls
                [NotifyParentProperty (true)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-               public Style ValidatorTextStyle
-               {
-                       get
-                       {
+               public Style ValidatorTextStyle {
+                       get {
                                if (_validatorTextStyle == null) {
                                        _validatorTextStyle = new Style ();
                                        if (IsTrackingViewState)
@@ -806,18 +721,16 @@ namespace System.Web.UI.WebControls
                        bool res = false;
                        try {
                                res = MembershipProviderInternal.ChangePassword (UserName, CurrentPassword, NewPassword);
+                       } catch {
                        }
-                       catch { }
                        
                        if (res) {
-
                                OnChangedPassword (args);
                                _showContinue = true;
 
                                if (_mailDefinition != null)
                                        SendMail (UserName, NewPassword);
-                       }
-                       else {
+                       } else {
                                OnChangePasswordError (EventArgs.Empty);
                                string lastError = string.Format (
                                        "Password incorrect or New Password invalid. New Password length minimum: {0}. Non-alphanumeric characters required: {1}.",
@@ -870,8 +783,7 @@ namespace System.Web.UI.WebControls
                        SmtpClient smtpClient = new SmtpClient ();
                        try {
                                smtpClient.Send (message);
-                       }
-                       catch (Exception e) {
+                       } catch (Exception e) {
                                SendMailErrorEventArgs mailArgs = new SendMailErrorEventArgs (e);
                                OnSendMailError (mailArgs);
                                if (!mailArgs.Handled)
@@ -883,15 +795,12 @@ namespace System.Web.UI.WebControls
 
                #region Properties
 
-               protected override HtmlTextWriterTag TagKey
-               {
+               protected override HtmlTextWriterTag TagKey {
                        get { return HtmlTextWriterTag.Table; }
                }
 
-               internal virtual MembershipProvider MembershipProviderInternal
-               {
-                       get
-                       {
+               internal virtual MembershipProvider MembershipProviderInternal {
+                       get {
                                if (_provider == null)
                                        InitMemberShipProvider ();
 
@@ -905,7 +814,8 @@ namespace System.Web.UI.WebControls
 
                protected internal override void LoadControlState (object savedState)
                {
-                       if (savedState == null) return;
+                       if (savedState == null)
+                               return;
                        object [] state = (object []) savedState;
                        base.LoadControlState (state [0]);
 
@@ -921,7 +831,6 @@ namespace System.Web.UI.WebControls
 
                protected override void LoadViewState (object savedState)
                {
-
                        if (savedState == null)
                                return;
 
@@ -1005,7 +914,6 @@ namespace System.Web.UI.WebControls
 
                protected override void TrackViewState ()
                {
-
                        base.TrackViewState ();
 
                        if (_cancelButtonStyle != null)
@@ -1052,10 +960,12 @@ namespace System.Web.UI.WebControls
                                        ProcessChangePasswordEvent (args);
                                        return true;
                                }
+
                                if (args.CommandName == CancelButtonCommandName) {
                                        ProcessCancelEvent (args);
                                        return true;
                                }
+
                                if (args.CommandName == ContinueButtonCommandName) {
                                        ProcessContinueEvent (args);
                                        return true;
@@ -1202,30 +1112,26 @@ namespace System.Web.UI.WebControls
                        }
 
                        // Requried controls
-                       public IEditableTextControl UserNameTextBox
-                       {
-                               get
-                               {
+                       public IEditableTextControl UserNameTextBox {
+                               get {
                                        Control c = FindControl ("UserName");
                                        if (c == null)
                                                throw new HttpException ("ChangePasswordTemplate does not contain an IEditableTextControl with ID UserName for the username, this is required if DisplayUserName=true.");
                                        return c as IEditableTextControl;
                                }
                        }
-                       public IEditableTextControl CurrentPasswordTextBox
-                       {
-                               get
-                               {
+                       
+                       public IEditableTextControl CurrentPasswordTextBox {
+                               get {
                                        Control c = FindControl ("CurrentPassword");
                                        if (c == null)
                                                throw new HttpException ("ChangePasswordTemplate does not contain an IEditableTextControl with ID CurrentPassword for the current password.");
                                        return c as IEditableTextControl;
                                }
                        }
-                       public IEditableTextControl NewPasswordTextBox
-                       {
-                               get
-                               {
+                       
+                       public IEditableTextControl NewPasswordTextBox {
+                               get {
                                        Control c = FindControl ("NewPassword");
                                        if (c == null)
                                                throw new HttpException ("ChangePasswordTemplate does not contain an IEditableTextControl with ID NewPassword for the new password.");
@@ -1234,20 +1140,19 @@ namespace System.Web.UI.WebControls
                        }
 
                        // Optional controls
-                       public IEditableTextControl ConfirmNewPasswordTextBox
-                       {
+                       public IEditableTextControl ConfirmNewPasswordTextBox {
                                get { return FindControl ("ConfirmNewPassword") as IEditableTextControl; }
                        }
-                       public Control CancelButton
-                       {
+                       
+                       public Control CancelButton {
                                get { return FindControl ("Cancel"); }
                        }
-                       public Control ChangePasswordButton
-                       {
+                       
+                       public Control ChangePasswordButton {
                                get { return FindControl ("ChangePassword"); }
                        }
-                       public ITextControl FailureTextLiteral
-                       {
+                       
+                       public ITextControl FailureTextLiteral {
                                get { return FindControl ("FailureText") as ITextControl; }
                        }
                }
@@ -1281,8 +1186,7 @@ namespace System.Web.UI.WebControls
                                                cell1.ApplyStyle (s1);
 
                                        row.Controls.Add (cell1);
-                               }
-                               else {
+                               } else {
                                        cell0.ColumnSpan = 2;
                                        cell0.HorizontalAlign = HorizontalAlign.Center;
                                        if (s0 != null)
@@ -1399,9 +1303,9 @@ namespace System.Web.UI.WebControls
                                // Row #5
                                if (_owner.PasswordHintText.Length > 0) {
                                        table.Controls.Add (
-                                               CreateRow (new LiteralControl (""),
+                                               CreateRow (new LiteralControl (String.Empty),
                                                        new LiteralControl (_owner.PasswordHintText),
-                                                       new LiteralControl (""),
+                                                       new LiteralControl (String.Empty),
                                                        null, _owner.PasswordHintStyle));
                                }
 
@@ -1487,7 +1391,7 @@ namespace System.Web.UI.WebControls
                                ((IButtonControl) CancelButton).Text = _owner.CancelButtonText;
                                ((IButtonControl) CancelButton).CausesValidation = false;
 
-                               table.Controls.Add (CreateRow (ChangePasswordButton, CancelButton, new LiteralControl (""), null, null));
+                               table.Controls.Add (CreateRow (ChangePasswordButton, CancelButton, new LiteralControl (String.Empty), null, null));
 
                                // Row #10
                                TableRow linksRow = new TableRow ();
@@ -1584,6 +1488,7 @@ namespace System.Web.UI.WebControls
                        {
                                ID = "SuccessContainerID";
                        }
+
                        public Control ChangePasswordButton
                        {
                                get { return FindControl ("Continue"); }
@@ -1592,4 +1497,3 @@ namespace System.Web.UI.WebControls
        }
 }
 
-#endif
index 78cffc45e72ee581ba95a8d68ffb5afe00bb4878..0d02364ee33f589e98191f3c1dd58c2651ece472 100644 (file)
@@ -4,7 +4,7 @@
 // Author:
 //      Dick Porter  <dick@ximian.com>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -33,7 +33,8 @@ using System.Globalization;
 using System.Security.Permissions;
 using System.Web.Util;
 
-namespace System.Web.UI.WebControls {
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -42,24 +43,16 @@ namespace System.Web.UI.WebControls {
        [DataBindingHandler ("System.Web.UI.Design.TextDataBindingHandler, " + Consts.AssemblySystem_Design)]
        [DefaultEvent ("CheckedChanged")]
        [DefaultProperty ("Text")]
-#if NET_2_0
        [ControlValueProperty ("Checked", null)]
        [SupportsEventValidation]
-#endif         
-       public class CheckBox : WebControl, IPostBackDataHandler
-#if NET_2_0
-       , ICheckBoxControl
-#endif
+       public class CheckBox : WebControl, IPostBackDataHandler, ICheckBoxControl
        {
                string render_type;
                AttributeCollection common_attrs;
-
-#if NET_2_0
                AttributeCollection inputAttributes;
                StateBag inputAttributesState;
                AttributeCollection labelAttributes;
                StateBag labelAttributesState;
-#endif
                
                public CheckBox () : base (HtmlTextWriterTag.Input)
                {
@@ -72,59 +65,36 @@ namespace System.Web.UI.WebControls {
                }
 
                [DefaultValue (false)]
-#if NET_2_0
                [Themeable (false)]
-#endif         
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-               public virtual bool AutoPostBack 
-               {
-                       get {
-                               return (ViewState.GetBool ("AutoPostBack",
-                                                          false));
-                       }
-                       set {
-                               ViewState["AutoPostBack"] = value;
-                       }
+               public virtual bool AutoPostBack {
+                       get { return (ViewState.GetBool ("AutoPostBack", false)); }
+                       set { ViewState["AutoPostBack"] = value; }
                }
 
-#if NET_2_0
                [DefaultValue (false)]
                [Themeable (false)]
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-               public virtual bool CausesValidation 
-               {
+               public virtual bool CausesValidation {
                        get { return ViewState.GetBool ("CausesValidation", false); }
                        set { ViewState ["CausesValidation"] = value; }
                }
-#endif         
-               
 
                [DefaultValue (false)]
-#if NET_2_0
                [Bindable (true, BindingDirection.TwoWay)]
                [Themeable (false)]
-#else          
-               [Bindable (true)]
-#endif         
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-               public virtual bool Checked 
-               {
-                       get {
-                               return (ViewState.GetBool ("Checked", false));
-                       }
-                       set {
-                               ViewState["Checked"] = value;
-                       }
+               public virtual bool Checked {
+                       get { return (ViewState.GetBool ("Checked", false)); }
+                       set { ViewState["Checked"] = value; }
                }
 
-#if NET_2_0
                [Browsable (false)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public AttributeCollection InputAttributes 
-               {
+               public AttributeCollection InputAttributes {
                        get {
                                if (inputAttributes == null) {
                                        if (inputAttributesState == null) {
@@ -140,8 +110,7 @@ namespace System.Web.UI.WebControls {
 
                [Browsable (false)]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-               public AttributeCollection LabelAttributes
-               {
+               public AttributeCollection LabelAttributes {
                        get {
                                if (labelAttributes == null) {
                                        if (labelAttributesState == null) {
@@ -154,34 +123,21 @@ namespace System.Web.UI.WebControls {
                                return labelAttributes;
                        }
                }
-#endif         
 
                [DefaultValue ("")]
                [Bindable (true)]
-#if NET_2_0
                [Localizable (true)]
-#endif         
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
-               public virtual string Text 
-               {
-                       get {
-                               return (ViewState.GetString ("Text",
-                                                            String.Empty));
-                       }
-                       set {
-                               ViewState["Text"] = value;
-                       }
+               public virtual string Text {
+                       get { return (ViewState.GetString ("Text", String.Empty)); }
+                       set { ViewState["Text"] = value; }
                }
 
                [DefaultValue (TextAlign.Right)]
-#if ONLY_1_1
-               [Bindable (true)]
-#endif         
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
-               public virtual TextAlign TextAlign
-               {
+               public virtual TextAlign TextAlign {
                        get { return (TextAlign) ViewState.GetInt ("TextAlign", (int)TextAlign.Right); }
                        set {
                                if (value != TextAlign.Left &&
@@ -193,48 +149,35 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if NET_2_0
                [Themeable (false)]
                [DefaultValue ("")]
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Behavior")]
-               public virtual string ValidationGroup
-               {
+               public virtual string ValidationGroup {
                        get { return ViewState.GetString ("ValidationGroup", String.Empty); }
                        set { ViewState["ValidationGroup"] = value; }
                }
-#endif         
 
                static readonly object EventCheckedChanged = new object ();
                [WebSysDescription ("")]
                [WebCategory ("Action")]
-               public event EventHandler CheckedChanged 
-               {
-                       add {
-                               Events.AddHandler (EventCheckedChanged, value);
-                       }
-                       remove {
-                               Events.RemoveHandler (EventCheckedChanged, value);
-                       }
+               public event EventHandler CheckedChanged  {
+                       add { Events.AddHandler (EventCheckedChanged, value); }
+                       remove { Events.RemoveHandler (EventCheckedChanged, value); }
                }
 
                protected virtual void OnCheckedChanged (EventArgs e)
                {
                        EventHandler handler = (EventHandler)Events[EventCheckedChanged];
                        
-                       if (handler != null) {
+                       if (handler != null)
                                handler (this, e);
-                       }
                }
 
-               internal virtual string NameAttribute 
-               {
-                       get {
-                               return (this.UniqueID);
-                       }
+               internal virtual string NameAttribute {
+                       get { return (this.UniqueID); }
                }
                
-#if NET_2_0
                protected override void LoadViewState (object savedState)
                {
                        if (savedState == null) {
@@ -288,23 +231,15 @@ namespace System.Web.UI.WebControls {
                        if (labelAttributesState != null)
                                labelAttributesState.TrackViewState ();
                }
-#endif         
-
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void OnPreRender (EventArgs e)
+
+               protected internal override void OnPreRender (EventArgs e)
                {
                        base.OnPreRender (e);
                        Page page = Page;
                        
                        if (page != null && IsEnabled) {
                                page.RegisterRequiresPostBack (this);
-#if NET_2_0
                                page.RegisterEnabledControl (this);
-#endif
                        }
                }
 
@@ -312,35 +247,35 @@ namespace System.Web.UI.WebControls {
                {
                        attname = attname.ToUpper (Helpers.InvariantCulture);
                        switch (attname) {
-                       case "VALUE":
-                       case "CHECKED":
-                       case "SIZE":
-                       case "MAXLENGTH":
-                       case "SRC":
-                       case "ALT":
-                       case "USEMAP":
-                       case "DISABLED":
-                       case "READONLY":
-                       case "ACCEPT":
-                       case "ACCESSKEY":
-                       case "TABINDEX":
-                       case "ONFOCUS":
-                       case "ONBLUR":
-                       case "ONSELECT":
-                       case "ONCHANGE":
-                       case "ONCLICK":
-                       case "ONDBLCLICK":
-                       case "ONMOUSEDOWN":
-                       case "ONMOUSEUP":
-                       case "ONMOUSEOVER":
-                       case "ONMOUSEMOVE":
-                       case "ONMOUSEOUT":
-                       case "ONKEYPRESS":
-                       case "ONKEYDOWN":
-                       case "ONKEYUP":
-                               return true;
-                       default:
-                               return false;
+                               case "VALUE":
+                               case "CHECKED":
+                               case "SIZE":
+                               case "MAXLENGTH":
+                               case "SRC":
+                               case "ALT":
+                               case "USEMAP":
+                               case "DISABLED":
+                               case "READONLY":
+                               case "ACCEPT":
+                               case "ACCESSKEY":
+                               case "TABINDEX":
+                               case "ONFOCUS":
+                               case "ONBLUR":
+                               case "ONSELECT":
+                               case "ONCHANGE":
+                               case "ONCLICK":
+                               case "ONDBLCLICK":
+                               case "ONMOUSEDOWN":
+                               case "ONMOUSEUP":
+                               case "ONMOUSEOVER":
+                               case "ONMOUSEMOVE":
+                               case "ONMOUSEOUT":
+                               case "ONKEYPRESS":
+                               case "ONKEYDOWN":
+                               case "ONKEYUP":
+                                       return true;
+                               default:
+                                       return false;
                        }
                }
 
@@ -368,26 +303,18 @@ namespace System.Web.UI.WebControls {
                        
                        return false;
                }
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void Render (HtmlTextWriter w)
+
+               protected internal override void Render (HtmlTextWriter w)
                {
                        Page page = Page;
                        if (page != null) {
                                page.VerifyRenderingInServerForm (this);
-#if NET_2_0
                                page.ClientScript.RegisterForEventValidation (UniqueID);
-#endif
                        }
                        
                        bool need_span = ControlStyleCreated && !ControlStyle.IsEmpty;
                        if (need_span) {
-#if NET_2_0
                                AddDisplayStyleAttribute (w);
-#endif
                                ControlStyle.AddAttributesToRender (w, this);
                        }
 
@@ -403,13 +330,8 @@ namespace System.Web.UI.WebControls {
                                need_span = true;
                        }
 
-#if NET_2_0
                        if (HasAttributes && AddAttributesForSpan (w))
                                need_span = true;
-#else
-                       if (Attributes.Count > 0 && AddAttributesForSpan (w))
-                               need_span = true;
-#endif
 
                        if (need_span)
                                w.RenderBeginTag (HtmlTextWriterTag.Span);
@@ -436,24 +358,18 @@ namespace System.Web.UI.WebControls {
                        if (nameAttr != null && nameAttr.Length > 0)
                                w.AddAttribute (HtmlTextWriterAttribute.Name, nameAttr);
                        InternalAddAttributesToRender (w, enabled);
-#if NET_2_0
                        AddAttributesToRender (w);
                        if (inputAttributes != null)
                                inputAttributes.AddAttributes (w);
-#endif
+
                        if (Checked)
                                w.AddAttribute (HtmlTextWriterAttribute.Checked, "checked", false);
 
                        if (AutoPostBack) {
-#if NET_2_0
-                               string onclick = Page.ClientScript.GetPostBackEventReference (GetPostBackOptions (), true);
+                               Page page = Page;
+                               string onclick = page != null ? page.ClientScript.GetPostBackEventReference (GetPostBackOptions (), true) : String.Empty;
                                onclick = String.Concat ("setTimeout('", onclick.Replace ("\\", "\\\\").Replace ("'", "\\'"), "', 0)");
                                w.AddAttribute (HtmlTextWriterAttribute.Onclick, BuildScriptAttribute ("onclick", onclick));
-#else
-                                       w.AddAttribute (HtmlTextWriterAttribute.Onclick,
-                                                       BuildScriptAttribute ("onclick", Page.ClientScript.GetPostBackEventReference (this, String.Empty)));
-                                       w.AddAttribute ("language", "javascript", false);
-#endif
                        }
 
                        if (AccessKey.Length > 0)
@@ -469,13 +385,12 @@ namespace System.Web.UI.WebControls {
                        w.RenderEndTag ();
                }
 
-               void RenderLabel (HtmlTextWriter w) {
+               void RenderLabel (HtmlTextWriter w)
+               {
                        string text = Text;
                        if (text.Length > 0) {
-#if NET_2_0
                                if (labelAttributes != null)
                                        labelAttributes.AddAttributes (w);
-#endif
                                w.AddAttribute (HtmlTextWriterAttribute.For, ClientID);
                                w.RenderBeginTag (HtmlTextWriterTag.Label);
                                w.Write (text);
@@ -483,10 +398,7 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               bool LoadPostData (string postDataKey, NameValueCollection postCollection)
+               protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection)
                {
                        if (!IsEnabled)
                                return false;
@@ -503,16 +415,15 @@ namespace System.Web.UI.WebControls {
                        return (false);
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               void RaisePostDataChangedEvent ()
+               protected virtual void RaisePostDataChangedEvent ()
                {
-#if NET_2_0
                        ValidateEvent (UniqueID, String.Empty);
-                       if (CausesValidation)
-                               Page.Validate (ValidationGroup);
-#endif
+                       if (CausesValidation) {
+                               Page page = Page;
+                               if (page != null)
+                                       page.Validate (ValidationGroup);
+                       }
+                       
                        OnCheckedChanged (EventArgs.Empty);
                }
 
@@ -526,15 +437,17 @@ namespace System.Web.UI.WebControls {
                        RaisePostDataChangedEvent ();
                }
 
-#if NET_2_0
-               PostBackOptions GetPostBackOptions () {
+               PostBackOptions GetPostBackOptions ()
+               {
                        PostBackOptions options = new PostBackOptions (this);
                        options.ActionUrl = null;
                        options.ValidationGroup = null;
                        options.Argument = String.Empty;
                        options.RequiresJavaScriptProtocol = false;
                        options.ClientSubmit = true;
-                       options.PerformValidation = CausesValidation && Page != null && Page.AreValidatorsUplevel (ValidationGroup);
+
+                       Page page = Page;
+                       options.PerformValidation = CausesValidation && page != null && page.AreValidatorsUplevel (ValidationGroup);
                        if (options.PerformValidation)
                                options.ValidationGroup = ValidationGroup;
 
@@ -544,7 +457,6 @@ namespace System.Web.UI.WebControls {
                protected override void AddAttributesToRender (HtmlTextWriter writer)
                {
                }
-#endif
 
                internal virtual void InternalAddAttributesToRender (HtmlTextWriter w, bool enabled)
                {
index b7faf08a560480d0a56e047d319396e8265120d1..55490e8a389b8047c947293b1568925939a3371e 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Web.UI;
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        public class CheckBoxField : BoundField
@@ -49,33 +48,33 @@ namespace System.Web.UI.WebControls {
                        set { throw GetNotSupportedPropException ("ApplyFormatInEditMode"); }
                }
 
-           [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-           [BrowsableAttribute (false)]
-           [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
+               [BrowsableAttribute (false)]
+               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
                public override bool ConvertEmptyStringToNull {
                        get { throw GetNotSupportedPropException ("ConvertEmptyStringToNull"); } 
                        set { throw GetNotSupportedPropException ("ConvertEmptyStringToNull"); } 
                }
                
-           [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-           [BrowsableAttribute (false)]
-           [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
+               [BrowsableAttribute (false)]
+               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
                public override string DataFormatString {
                        get { throw GetNotSupportedPropException ("DataFormatString"); } 
                        set { throw GetNotSupportedPropException ("DataFormatString"); } 
                }
                
-           [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-           [BrowsableAttribute (false)]
-           [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
+               [BrowsableAttribute (false)]
+               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
                public override bool HtmlEncode {
                        get { throw GetNotSupportedPropException ("HtmlEncode"); } 
                        set { throw GetNotSupportedPropException ("HtmlEncode"); } 
                }
                
-           [EditorBrowsableAttribute (EditorBrowsableState.Never)]
-           [BrowsableAttribute (false)]
-           [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+               [EditorBrowsableAttribute (EditorBrowsableState.Never)]
+               [BrowsableAttribute (false)]
+               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
                public override string NullDisplayText {
                        get { throw GetNotSupportedPropException ("NullDisplayText"); } 
                        set { throw GetNotSupportedPropException ("NullDisplayText"); } 
@@ -90,7 +89,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public virtual string Text {
-                       get { return ViewState.GetString ("Text", ""); }
+                       get { return ViewState.GetString ("Text", String.Empty); }
                        set {
                                ViewState ["Text"] = value;
                                OnFieldChanged ();
@@ -141,12 +140,13 @@ namespace System.Web.UI.WebControls {
                                
                                if (val != null && val != DBNull.Value)
                                        box.Checked = (bool) val;
-                               else
+                               else {
                                        if (string.IsNullOrEmpty (DataField)) {
                                                box.Visible = false;
                                                return;
                                        }
-
+                               }
+                               
                                if (!box.Visible)
                                        box.Visible = true;
                        } catch (HttpException) {
@@ -175,4 +175,4 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
+
index c36e159aa2429ef1ec626dd36d4dd389d2929585..c59c1e1ecfe79351a37e8385fcd8d2f58b5ed3f9 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Jackson Harper (jackson@ximian.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,8 +32,8 @@ using System.ComponentModel;
 using System.Security.Permissions;
 using System.Web.Util;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
@@ -47,9 +47,6 @@ namespace System.Web.UI.WebControls {
                        Controls.Add (check_box);
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(-1)]
                [WebSysDescription ("")]
                [WebCategory ("Layout")]
@@ -58,9 +55,6 @@ namespace System.Web.UI.WebControls {
                        set { TableStyle.CellPadding = value; }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(-1)]
                [WebSysDescription ("")]
                [WebCategory ("Layout")]
@@ -69,9 +63,6 @@ namespace System.Web.UI.WebControls {
                        set { TableStyle.CellSpacing = value; }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(0)]
                [WebSysDescription ("")]
                [WebCategory ("Layout")]
@@ -84,17 +75,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(RepeatDirection.Vertical)]
                [WebSysDescription ("")]
                [WebCategory ("Layout")]
                public virtual RepeatDirection RepeatDirection {
-                       get {
-                               return (RepeatDirection) ViewState.GetInt ("RepeatDirection",
-                                               (int) RepeatDirection.Vertical);
-                       }
+                       get { return (RepeatDirection) ViewState.GetInt ("RepeatDirection", (int) RepeatDirection.Vertical); }
                        set {
                                if (value < RepeatDirection.Horizontal ||
                                                value > RepeatDirection.Vertical)
@@ -103,17 +88,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(RepeatLayout.Table)]
                [WebSysDescription ("")]
                [WebCategory ("Layout")]
                public virtual RepeatLayout RepeatLayout {
-                       get {
-                               return (RepeatLayout) ViewState.GetInt ("RepeatLayout",
-                                               (int) RepeatLayout.Table);
-                       }
+                       get { return (RepeatLayout) ViewState.GetInt ("RepeatLayout", (int) RepeatLayout.Table); }
                        set {
                                if (value < RepeatLayout.Table ||
                                                value > RepeatLayout.Flow)
@@ -122,17 +101,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
 
-#if ONLY_1_1
-               [Bindable(true)]
-#endif         
                [DefaultValue(TextAlign.Right)]
                [WebSysDescription ("")]
                [WebCategory ("Appearance")]
                public virtual TextAlign TextAlign {
-                       get {
-                               return (TextAlign) ViewState.GetInt ("TextAlign",
-                                               (int) TextAlign.Right);
-                       }
+                       get { return (TextAlign) ViewState.GetInt ("TextAlign", (int) TextAlign.Right); }
                        set {
                                if (value < TextAlign.Left || value > TextAlign.Right)
                                        throw new ArgumentOutOfRangeException ("value");
@@ -155,36 +128,27 @@ namespace System.Web.UI.WebControls {
                        return this;
                }
 
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void OnPreRender (EventArgs e)
+               protected internal override void OnPreRender (EventArgs e)
                {
                        base.OnPreRender (e);
 
                        // Register all of the checked controls so we can
                        // find out when they are unchecked.
+                       Page page = Page;
                        for (int i = 0; i < Items.Count; i++) {
                                if (Items [i].Selected) {
                                        check_box.ID = i.ToString (Helpers.InvariantCulture);
-                                       Page.RegisterRequiresPostBack (check_box);
+                                       if (page != null)
+                                               page.RegisterRequiresPostBack (check_box);
                                }
                        }
                }
 
-#if NET_2_0
-               protected internal
-#else          
-               protected
-#endif         
-               override void Render (HtmlTextWriter writer)
+               protected internal override void Render (HtmlTextWriter writer)
                {
-#if NET_2_0
                        if (Items.Count == 0)
                                return;
-#endif
+
                        RepeatInfo ri = new RepeatInfo ();
                        ri.RepeatColumns = RepeatColumns;
                        ri.RepeatDirection = RepeatDirection;
@@ -196,31 +160,24 @@ namespace System.Web.UI.WebControls {
                                ti = TabIndex;
                                TabIndex = 0;
                        }
-#if NET_2_0
+
                        string ak = AccessKey;
                        check_box.AccessKey = ak;
                        this.AccessKey = null;
-#endif
 
                        ri.RenderRepeater (writer, this, TableStyle, this);
 
                        if (ti != 0)
                                TabIndex = ti;
-#if NET_2_0
                        this.AccessKey = ak;
-#endif
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               bool LoadPostData (string postDataKey, NameValueCollection postCollection)
+               protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection)
                {
                        if (!IsEnabled)
                                return false;
-#if NET_2_0
+
                        EnsureDataBound ();
-#endif
                        int checkbox = -1;
 
                        try {
@@ -237,9 +194,7 @@ namespace System.Web.UI.WebControls {
                        string val = postCollection [postDataKey];
                        bool ischecked = val == "on";
                        ListItem item = Items [checkbox];
-#if NET_2_0
-                       if (item.Enabled)
-#endif
+                       if (item.Enabled) {
                                if (ischecked && !item.Selected) {
                                        item.Selected = true;
                                        return true;
@@ -247,24 +202,23 @@ namespace System.Web.UI.WebControls {
                                        item.Selected = false;
                                        return true;
                                }
-
+                       }
+                       
                        return false;
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               void RaisePostDataChangedEvent ()
+               protected virtual void RaisePostDataChangedEvent ()
                {
-#if NET_2_0
-                       if (CausesValidation)
-                               Page.Validate (ValidationGroup);
-#endif
+                       if (CausesValidation) {
+                               Page page = Page;
+                               if (page != null)
+                                       page.Validate (ValidationGroup);
+                       }
+                       
                        OnSelectedIndexChanged (EventArgs.Empty);
                }
 
-               bool IPostBackDataHandler.LoadPostData (string postDataKey,
-                                                       NameValueCollection postCollection)
+               bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
                {
                        return LoadPostData (postDataKey, postCollection);
                }
@@ -274,85 +228,49 @@ namespace System.Web.UI.WebControls {
                        RaisePostDataChangedEvent ();
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               bool HasFooter 
-               {
-                       get {
-                               return false;
-                       }
+               protected virtual bool HasFooter  {
+                       get { return false; }
                }
 
                bool IRepeatInfoUser.HasFooter {
                        get { return HasFooter; }
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               bool HasHeader
-               {
-                       get {
-                               return false;
-                       }
+               protected virtual bool HasHeader {
+                       get { return false; }
                }
 
                bool IRepeatInfoUser.HasHeader {
                        get { return HasHeader; }
                }
 
-
-#if NET_2_0
-               protected virtual
-#endif
-               bool HasSeparators
-               {
-                       get {
-                               return false;
-                       }
+               protected virtual bool HasSeparators {
+                       get { return false; }
                }
 
                bool IRepeatInfoUser.HasSeparators {
                        get { return HasSeparators; }
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               int RepeatedItemCount
-               {
-                       get {
-                               return Items.Count;
-                       }
+               protected virtual int RepeatedItemCount {
+                       get { return Items.Count; }
                }
 
                int IRepeatInfoUser.RepeatedItemCount {
                        get { return RepeatedItemCount; }
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               Style GetItemStyle (ListItemType itemType,
-                                   int repeatIndex)
+               protected virtual Style GetItemStyle (ListItemType itemType, int repeatIndex)
                {
                        return null;
                }
 
-               Style IRepeatInfoUser.GetItemStyle (ListItemType itemType,
-                                                   int repeatIndex)
+               Style IRepeatInfoUser.GetItemStyle (ListItemType itemType, int repeatIndex)
                {
                        return GetItemStyle (itemType, repeatIndex);
                }
 
-#if NET_2_0
-               protected virtual
-#endif
-               void RenderItem (ListItemType itemType,
-                                int repeatIndex,
-                                RepeatInfo repeatInfo,
-                                HtmlTextWriter writer)
+               protected virtual void RenderItem (ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
                {
                        ListItem item = Items [repeatIndex];
 
@@ -365,30 +283,27 @@ namespace System.Web.UI.WebControls {
                                check_box.Enabled = false;
                        else
                                check_box.Enabled = item.Enabled;
-#if NET_2_0
+
                        check_box.ValidationGroup = ValidationGroup;
                        check_box.CausesValidation = CausesValidation;
                        if (check_box.HasAttributes)
                                check_box.Attributes.Clear ();
                        if (item.HasAttributes)
                                check_box.Attributes.CopyFrom (item.Attributes);
-#endif
+
                        check_box.RenderControl (writer);
                }
 
-               void IRepeatInfoUser.RenderItem (ListItemType itemType,
-                                                int repeatIndex, RepeatInfo repeatInfo,
-                                                HtmlTextWriter writer)
+               void IRepeatInfoUser.RenderItem (ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
                {
                        RenderItem (itemType, repeatIndex, repeatInfo, writer);
                }
-#if NET_2_0
-        protected internal override void VerifyMultiSelect()
-        {
-            //by default the ListControl will throw an exception in this method,
-            //therefor we should override the method if the class is supporting
-            //MultiSelect option.
-        }
-#endif
-    }
+
+               protected internal override void VerifyMultiSelect()
+               {
+                       //by default the ListControl will throw an exception in this method,
+                       //therefor we should override the method if the class is supporting
+                       //MultiSelect option.
+               }
+       }
 }
index 3a29834bc4067cd736513c933d3cdc5b0666983f..e4fe8a7a8e54515da0dc9ac41c32c2565dcbe665 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -25,8 +25,6 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
 using System;
 using System.Globalization;
 using System.Web;
@@ -35,19 +33,11 @@ using System.ComponentModel;
 
 namespace System.Web.UI.WebControls
 {
-#if NET_2_0
        internal class ChildTable : Table
-#else
-       internal class TableID : Table
-#endif
        {
                Control parent;
 
-#if NET_2_0
                public ChildTable (Control parent)
-#else
-               public TableID (Control parent)
-#endif
                {
                        this.parent = parent;
                }
@@ -60,6 +50,3 @@ namespace System.Web.UI.WebControls
                }
        }
 }
-
-
-
index 41ea6fd4bfb1e839ae8695c5883ce8d785e1c72b..d7b7b593335e5bcbd1d155b1d6f2c67ef466dbe0 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System.ComponentModel;
 
 namespace System.Web.UI.WebControls
@@ -69,4 +67,3 @@ namespace System.Web.UI.WebControls
        }
 }
 
-#endif
index 6819a7c94f21e4cfffc5b4c9b0f51d10e6504cf0..c99cdd0088b0aa16a1348c5c1bd851862786c41a 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc.
+// (C) 2005-2010 Novell, Inc.
 //
 
 //
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Text;
@@ -81,5 +80,5 @@ namespace System.Web.UI.WebControls
                }
        }
 }
-#endif
+
 
index 377f717e3e61bdfbdcf2d8cc833b55622bb21466..a046105bdb8391566950b6ec02ad339a98563139 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Web.UI;
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        public class CommandField : ButtonFieldBase
@@ -47,7 +46,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public virtual string CancelImageUrl {
-                       get { return ViewState.GetString ("CancelImageUrl", ""); }
+                       get { return ViewState.GetString ("CancelImageUrl", String.Empty); }
                        set {
                                ViewState ["CancelImageUrl"] = value;
                                OnFieldChanged ();
@@ -80,7 +79,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public virtual string DeleteImageUrl {
-                       get { return ViewState.GetString ("DeleteImageUrl", ""); }
+                       get { return ViewState.GetString ("DeleteImageUrl", String.Empty); }
                        set {
                                ViewState ["DeleteImageUrl"] = value;
                                OnFieldChanged ();
@@ -104,7 +103,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public virtual string EditImageUrl {
-                       get { return ViewState.GetString ("EditImageUrl", ""); }
+                       get { return ViewState.GetString ("EditImageUrl", String.Empty); }
                        set {
                                ViewState ["EditImageUrl"] = value;
                                OnFieldChanged ();
@@ -128,7 +127,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public virtual string InsertImageUrl {
-                       get { return ViewState.GetString ("InsertImageUrl", ""); }
+                       get { return ViewState.GetString ("InsertImageUrl", String.Empty); }
                        set {
                                ViewState ["InsertImageUrl"] = value;
                                OnFieldChanged ();
@@ -152,7 +151,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public virtual string NewImageUrl {
-                       get { return ViewState.GetString ("NewImageUrl", ""); }
+                       get { return ViewState.GetString ("NewImageUrl", String.Empty); }
                        set {
                                ViewState ["NewImageUrl"] = value;
                                OnFieldChanged ();
@@ -176,7 +175,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public virtual string SelectImageUrl {
-                       get { return ViewState.GetString ("SelectImageUrl", ""); }
+                       get { return ViewState.GetString ("SelectImageUrl", String.Empty); }
                        set {
                                ViewState ["SelectImageUrl"] = value;
                                OnFieldChanged ();
@@ -255,7 +254,7 @@ namespace System.Web.UI.WebControls {
                [WebSysDescription ("")]
                [WebCategoryAttribute ("Appearance")]
                public virtual string UpdateImageUrl {
-                       get { return ViewState.GetString ("UpdateImageUrl", ""); }
+                       get { return ViewState.GetString ("UpdateImageUrl", String.Empty); }
                        set {
                                ViewState ["UpdateImageUrl"] = value;
                                OnFieldChanged ();
@@ -273,13 +272,11 @@ namespace System.Web.UI.WebControls {
                        }
                }
                
-               public override void InitializeCell (DataControlFieldCell cell,
-                       DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
+               public override void InitializeCell (DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
                {
                        string index = rowIndex.ToString ();
                        
-                       if (cellType == DataControlCellType.DataCell)
-                       {
+                       if (cellType == DataControlCellType.DataCell) {
                                if ((rowState & DataControlRowState.Edit) != 0) {
                                        if (ShowEditButton) {
                                                cell.Controls.Add (CreateButton (UpdateText, UpdateImageUrl, DataControlCommands.UpdateCommandName, index));
@@ -377,4 +374,4 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
+
index fdb3a1bae2896bd72947483927ffd5f9f54ffab7..fb29d66e8e7d57e96735376ba921b6e4f116320d 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Chris Toshok (toshok@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -30,16 +30,13 @@ using System.Globalization;
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        // attributes
-#if NET_2_0
        [ToolboxData("<{0}:CompareValidator runat=\"server\" ErrorMessage=\"CompareValidator\"></{0}:CompareValidator>")]
-#else
-       [ToolboxData("<{0}:CompareValidator runat=server ErrorMessage=\"CompareValidator\"></{0}:CompareValidator>")]
-#endif
        public class CompareValidator : BaseCompareValidator
        {
                public CompareValidator ()
@@ -49,21 +46,12 @@ namespace System.Web.UI.WebControls {
                protected override void AddAttributesToRender (HtmlTextWriter w)
                {
                        if (RenderUplevel) {
-#if NET_2_0
                                RegisterExpandoAttribute (ClientID, "evaluationfunction", "CompareValidatorEvaluateIsValid");
                                if (ControlToCompare.Length > 0)
                                        RegisterExpandoAttribute (ClientID, "controltocompare", GetControlRenderID (ControlToCompare));
                                if (ValueToCompare.Length > 0)
                                        RegisterExpandoAttribute (ClientID, "valuetocompare", ValueToCompare, true);
                                RegisterExpandoAttribute (ClientID, "operator", Operator.ToString ());
-#else
-                               if (ControlToCompare != "")
-                                       w.AddAttribute ("controltocompare", GetControlRenderID(ControlToCompare));
-                               if (ValueToCompare != "")
-                                       w.AddAttribute ("valuetocompare", ValueToCompare);
-                               w.AddAttribute ("operator", Operator.ToString());
-                               w.AddAttribute ("evaluationfunction", "CompareValidatorEvaluateIsValid", false);
-#endif
                        }
 
                        base.AddAttributesToRender (w);
@@ -72,8 +60,7 @@ namespace System.Web.UI.WebControls {
                protected override bool ControlPropertiesValid ()
                {
                        if ((this.Operator != ValidationCompareOperator.DataTypeCheck) && ControlToCompare.Length == 0 &&
-                           !BaseCompareValidator.CanConvert (this.ValueToCompare, this.Type, this.CultureInvariantValues))
-                       {
+                           !BaseCompareValidator.CanConvert (this.ValueToCompare, this.Type, this.CultureInvariantValues)) {
                                throw new HttpException(
                                        String.Format("Unable to convert the value: {0} as a {1}", ValueToCompare,
                                                      Enum.GetName(typeof(ValidationDataType), this.Type)));
@@ -82,7 +69,7 @@ namespace System.Web.UI.WebControls {
                        if (ControlToCompare.Length > 0) {
                                if (string.CompareOrdinal (ControlToCompare, ControlToValidate) == 0)
                                        throw new HttpException (String.Format ("Control '{0}' cannot have the same value '{1}' for both ControlToValidate and ControlToCompare.", ID, ControlToCompare));
-                               CheckControlValidationProperty (ControlToCompare, "");
+                               CheckControlValidationProperty (ControlToCompare, String.Empty);
                        }
                        
                        return base.ControlPropertiesValid ();
@@ -101,7 +88,8 @@ namespace System.Web.UI.WebControls {
 
                        string compare;
                        /* ControlToCompare takes precendence, if it's set. */
-                       compare = (ControlToCompare != "" ? GetControlValidationValue (ControlToCompare) : ValueToCompare);
+                       string controlToCompare = ControlToCompare;
+                       compare = (!String.IsNullOrEmpty (controlToCompare) ? GetControlValidationValue (controlToCompare) : ValueToCompare);
 
                        return BaseCompareValidator.Compare (GetControlValidationValue (ControlToValidate), false, 
                                                             compare, this.CultureInvariantValues,
@@ -112,9 +100,7 @@ namespace System.Web.UI.WebControls {
                [TypeConverter(typeof(System.Web.UI.WebControls.ValidatedControlConverter))]
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-#if NET_2_0
                [Themeable (false)]
-#endif
                public string ControlToCompare {
                        get { return ViewState.GetString ("ControlToCompare", String.Empty); }
                        set { ViewState["ControlToCompare"] = value; }
@@ -123,23 +109,17 @@ namespace System.Web.UI.WebControls {
                [DefaultValue(ValidationCompareOperator.Equal)]
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-#if NET_2_0
                [Themeable (false)]
-#endif
                public ValidationCompareOperator Operator {
                        get { return (ValidationCompareOperator)ViewState.GetInt ("Operator", (int)ValidationCompareOperator.Equal); }
                        set { ViewState ["Operator"] = (int)value; }
                }
 
-#if !NET_2_0
                [Bindable(true)]
-#endif
                [DefaultValue("")]
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-#if NET_2_0
                [Themeable (false)]
-#endif
                public string ValueToCompare {
                        get { return ViewState.GetString ("ValueToCompare", String.Empty); }
                        set { ViewState ["ValueToCompare"] = value; }
index 1a4e972217939555b7ce60972377168b9909e6c6..7b0b20e380d4846155afe61f66c0f6eadda74d01 100644 (file)
@@ -24,8 +24,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Web;
 using System.Web.UI;
@@ -44,22 +42,18 @@ namespace System.Web.UI.WebControls
                // MSDN: The StepType property overrides the WizardStepBase.StepType property to ensure that CompleteWizardStep is always set to the Complete value of 
                // the WizardStepType enumeration. Attempting to set the StepType property to a different value will result in an InvalidOperationException.
                [ThemeableAttribute (false)]
-               public override WizardStepType StepType
-               {
+               public override WizardStepType StepType {
                        get { return WizardStepType.Complete; }
                        set { throw new InvalidOperationException (); }
                }
 
                [LocalizableAttribute (true)]
-               public override string Title
-               {
-                       get
-                       {
+               public override string Title {
+                       get {
                                object o = ViewState ["TitleText"];
                                return (o == null) ? Locale.GetText ("Complete") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("TitleText");
                                else
@@ -70,4 +64,3 @@ namespace System.Web.UI.WebControls
 
 }
 
-#endif
index 2d006b14aef402e755ec392236d5e40742faed29..5c97f360a8a2eec07814c72609f9c7a9764fab53 100644 (file)
@@ -4,7 +4,7 @@
 // Authors: Ben Maurer <bmaurer@novell.com>
 //          Chris Toshok <toshok@novell.com>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        // attributes
        [Designer ("System.Web.UI.Design.WebControls.CompositeControlDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
-       public abstract class CompositeControl : WebControl, INamingContainer, ICompositeControlDesignerAccessor {
-
+       public abstract class CompositeControl : WebControl, INamingContainer, ICompositeControlDesignerAccessor
+       {
                protected CompositeControl ()
                {
                }
@@ -84,4 +82,3 @@ namespace System.Web.UI.WebControls {
        }
 }
 
-#endif
index 22a97483595d2ebfda99332a29d940fe2b670b31..c262c47e029065a655a6ab31cbbcfe436d7ad47e 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Collections;
 
@@ -41,8 +39,7 @@ namespace System.Web.UI.WebControls
                {
                }
 
-               public override ControlCollection Controls
-               {
+               public override ControlCollection Controls {
                        get {
                                EnsureChildControls();
                                return base.Controls;
@@ -57,8 +54,7 @@ namespace System.Web.UI.WebControls
                        if (itemCount != null) {
                                object [] data = new object [(int) itemCount];
                                CreateChildControls (data, false);
-                       }
-                       else if (RequiresDataBinding)
+                       } else if (RequiresDataBinding)
                                EnsureDataBound ();
                }
                
@@ -72,5 +68,3 @@ namespace System.Web.UI.WebControls
                protected abstract int CreateChildControls (IEnumerable dataSource, bool dataBinding);
        }
 }
-
-#endif
index 4bcce397103a10873bde8180ea5d9c35f5c5a55c..3921ebe022adb09636e52bee2fb171b238bf6672 100644 (file)
@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -38,12 +36,13 @@ namespace System.Web.UI.WebControls
        {
                WebControl _container;
 
-               public ContainedTable (WebControl container) {
+               public ContainedTable (WebControl container)
+               {
                        _container = container;
                }
 
-               protected override void AddAttributesToRender (HtmlTextWriter writer) {
-
+               protected override void AddAttributesToRender (HtmlTextWriter writer)
+               {
                        ControlStyle.CopyFrom (_container.ControlStyle);
                        writer.AddAttribute (HtmlTextWriterAttribute.Id, _container.ClientID);
 
@@ -52,4 +51,3 @@ namespace System.Web.UI.WebControls
        }
 }
 
-#endif
index e61a9bc4419602d62134d10631e3a7c60268b058..a1b8f553a287c24847aac21c99c82ed80c5d79b7 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc.
+// (C) 2005-2010 Novell, Inc.
 //
 
 //
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.ComponentModel;
 
@@ -95,4 +93,3 @@ namespace System.Web.UI.WebControls
        }
 }
 
-#endif
index 540dfca89229c93b4457475c5451ee42718eb67f..40200b53e71c146247056479aa51b14507632441 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc.
+// (C) 2005-2010 Novell, Inc.
 //
 
 //
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Collections;
 using System.Web.UI.WebControls;
@@ -40,12 +38,8 @@ namespace System.Web.UI.WebControls
        {
                string placeHolderID;
                
-               public override void Init (TemplateParser parser,
-                                         ControlBuilder parentBuilder,
-                                         Type type,
-                                         string tagName,
-                                         string ID,
-                                         IDictionary attribs)
+               public override void Init (TemplateParser parser, ControlBuilder parentBuilder, Type type,
+                                          string tagName, string ID, IDictionary attribs)
                {
                        base.Init (parser, parentBuilder, type, tagName, ID, attribs);
                        placeHolderID = attribs ["ContentPlaceHolderID"] as string;
@@ -59,4 +53,3 @@ namespace System.Web.UI.WebControls
        }
 }
 
-#endif
index b9566b9d2306ad6eefe482a253e0e0f04c1e6c4c..7dd164ed3b8d9d60a97575a4d4413d4f83d5a911 100644 (file)
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 
-#if NET_2_0
-namespace System.Web.UI.WebControls {
-        public enum ContentDirection {
+namespace System.Web.UI.WebControls
+{
+        public enum ContentDirection
+       {
                 NotSet = 0,
                LeftToRight = 1,
                RightToLeft = 2
        }
 }
-#endif
+
index 167113fdfe60950fc34ca40cd00ad46e3f6bd5fd..5dc6cc60fa47f9e965b477de3c11a9b5707bdff4 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc.
+// (C) 2005-2010 Novell, Inc.
 //
 
 //
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Collections;
 using System.ComponentModel;
@@ -47,4 +45,3 @@ namespace System.Web.UI.WebControls
        }
 }
 
-#endif
index a78d34508e50572b0475dd6337f5aa7ed2e23b01..21e05d41de326ed457831c4c7257b75b61336f07 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc.
+// (C) 2005-2010 Novell, Inc.
 //
 
 //
@@ -28,8 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Collections;
 using System.Web.UI.WebControls;
@@ -39,18 +37,15 @@ namespace System.Web.UI.WebControls
        internal class ContentPlaceHolderBuilder: ControlBuilder
        {
 #if !TARGET_J2EE
-               public override void Init (TemplateParser parser,
-                                          ControlBuilder parentBuilder,
-                                          Type type,
-                                          string tagName,
-                                          string ID,
-                                          IDictionary attribs)
+               public override void Init (TemplateParser parser, ControlBuilder parentBuilder, Type type,
+                                          string tagName, string ID, IDictionary attribs)
                {
                        string id = null, s;
                        foreach (object k in attribs.Keys) {
                                s = k as string;
                                if (String.IsNullOrEmpty (s))
                                        continue;
+                               
                                if (String.Compare (s, "id", StringComparison.OrdinalIgnoreCase) == 0) {
                                        id = attribs [s] as string;
                                        break;
@@ -67,4 +62,3 @@ namespace System.Web.UI.WebControls
        }
 }
 
-#endif
index f50de756a641d415e3e54f3af307abf0185379b4..73ee7777b89c7c009289f0fc4a979dd32368c941 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //      Sanjay Gupta (gsanjay@novell.com)
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 //
 // Permission is hereby granted, free of charge, to any person obtaining
@@ -27,8 +27,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-
-#if NET_2_0
 using System;
 using System.ComponentModel;
 using System.Collections;
@@ -36,7 +34,6 @@ using System.Collections;
 namespace System.Web.UI.WebControls
 {
        public class ControlIDConverter : StringConverter
-
        {
                public ControlIDConverter ()
                { }
@@ -51,8 +48,7 @@ namespace System.Web.UI.WebControls
                        return null;
                }*/
 
-               public override TypeConverter.StandardValuesCollection GetStandardValues
-                                                       (ITypeDescriptorContext context)
+               public override TypeConverter.StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
                {
                        if (context == null)
                                return null;
@@ -97,5 +93,4 @@ namespace System.Web.UI.WebControls
                }
        }
 }
-#endif
 
index d54faa156f969da0304cc69a1694579e990db01c..9467ad227568f10e2e97a4d21660b7a854582591 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Data;
@@ -36,11 +35,11 @@ using System.Text;
 using System.ComponentModel;
 using System.Reflection;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [DefaultPropertyAttribute ("ControlID")]
-       public class ControlParameter : Parameter {
-
+       public class ControlParameter : Parameter
+       {
                public ControlParameter () : base ()
                {
                }
@@ -122,7 +121,7 @@ namespace System.Web.UI.WebControls {
                [DefaultValueAttribute ("")]
                [IDReferencePropertyAttribute (typeof(System.Web.UI.Control))]
                public string ControlID {
-                       get { return ViewState.GetString ("ControlID", ""); }
+                       get { return ViewState.GetString ("ControlID", String.Empty); }
                        set {
                                if (ControlID != value) {
                                        ViewState ["ControlID"] = value;
@@ -135,7 +134,7 @@ namespace System.Web.UI.WebControls {
                [TypeConverterAttribute (typeof (ControlPropertyNameConverter))]
                [WebCategoryAttribute ("Control")]
                public string PropertyName {
-                       get { return ViewState.GetString ("PropertyName", ""); }
+                       get { return ViewState.GetString ("PropertyName", String.Empty); }
                        set {
                                
                                if (PropertyName != value) {
@@ -146,5 +145,5 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
+
 
index c29b4f05a964e3c1e55478dfb9350c989bb057b0..8e2041fbcaab5a4ee5da4a423e8e613983583a8c 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //     Lluis Sanchez Gual (lluis@novell.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 
-#if NET_2_0
-
 using System.ComponentModel;
 
 namespace System.Web.UI.WebControls
@@ -57,5 +54,3 @@ namespace System.Web.UI.WebControls
                }
        }
 }
-
-#endif
index 9c3ba818ed6c3b986602e2284beb940da120d0ab..ad6e81abf96454fb0d1e7233efdc278f67e7b5ab 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System.Collections;
 using System.Collections.Specialized;
 using System.Data;
 using System.Text;
 using System.ComponentModel;
 
-namespace System.Web.UI.WebControls {
-
+namespace System.Web.UI.WebControls
+{
        [DefaultPropertyAttribute ("CookieName")]
-       public class CookieParameter : Parameter {
-
+       public class CookieParameter : Parameter
+       {
                public CookieParameter () : base ()
                {
                }
@@ -87,7 +86,7 @@ namespace System.Web.UI.WebControls {
                
                [DefaultValueAttribute ("")]
                public string CookieName {
-                       get { return ViewState.GetString ("CookieName", ""); }
+                       get { return ViewState.GetString ("CookieName", String.Empty); }
                        set {
                                if (CookieName != value) {
                                        ViewState ["CookieName"] = value;
@@ -99,6 +98,6 @@ namespace System.Web.UI.WebControls {
        
        }
 }
-#endif
+
 
 
index 900f36ecbbad1484468bad615668185fa22941ac..580c655aef2297114d32ce530124e14555392025 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Sanjay Gupta (gsanjay@novell.com)
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
-
 using System.Web.Security;
 
-namespace System.Web.UI.WebControls {
+namespace System.Web.UI.WebControls
+{
        public class CreateUserErrorEventArgs : EventArgs 
        {
                MembershipCreateStatus status;
@@ -47,4 +46,4 @@ namespace System.Web.UI.WebControls {
                }
        }
 }
-#endif
+
index 5bfd7e652baecaccadeefbbcd86e71536420e31e..708b20479b5fa69679f2b4a7cf133ae8c559ee7a 100644 (file)
@@ -4,7 +4,7 @@
 // Authors:
 //   Sanjay Gupta (gsanjay@novell.com)
 //
-// (C) 2004 Novell, Inc (http://www.novell.com)
+// (C) 2004-2010 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -27,8 +27,9 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-#if NET_2_0
-namespace System.Web.UI.WebControls {
+
+namespace System.Web.UI.WebControls
+{
        public delegate void CreateUserErrorEventHandler (object sender, CreateUserErrorEventArgs e);
 }
-#endif
+
index 5e1f17f4088a4f6abae1875a45bdc1418ab5cfdd..11bb56572f413cfa18b1f633dd36fc02270b2d58 100644 (file)
@@ -24,8 +24,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Web;
 using System.Web.UI;
@@ -77,23 +75,19 @@ namespace System.Web.UI.WebControls
 
                #region Public Properties
 
-               public override int ActiveStepIndex
-               {
+               public override int ActiveStepIndex {
                        get { return base.ActiveStepIndex; }
                        set { base.ActiveStepIndex = value; }
                }
 
                [LocalizableAttribute (true)]
                [ThemeableAttribute (false)]
-               public virtual string Answer
-               {
-                       get
-                       {
+               public virtual string Answer {
+                       get {
                                object o = ViewState ["Answer"];
                                return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("Answer");
                                else
@@ -102,15 +96,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string AnswerLabelText
-               {
-                       get
-                       {
+               public virtual string AnswerLabelText {
+                       get {
                                object o = ViewState ["AnswerLabelText"];
                                return (o == null) ? Locale.GetText ("Security Answer:") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("AnswerLabelText");
                                else
@@ -119,15 +110,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string AnswerRequiredErrorMessage
-               {
-                       get
-                       {
+               public virtual string AnswerRequiredErrorMessage {
+                       get {
                                object o = ViewState ["AnswerRequiredErrorMessage"];
                                return (o == null) ? Locale.GetText ("Security answer is required.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("AnswerRequiredErrorMessage");
                                else
@@ -136,23 +124,16 @@ namespace System.Web.UI.WebControls
                }
 
                [ThemeableAttribute (false)]
-               public virtual bool AutoGeneratePassword
-               {
-                       get
-                       {
+               public virtual bool AutoGeneratePassword {
+                       get {
                                object o = ViewState ["AutoGeneratePassword"];
                                return (o == null) ? false : (bool) o;
                        }
-                       set
-                       {
-                               ViewState ["AutoGeneratePassword"] = value;
-                       }
+                       set { ViewState ["AutoGeneratePassword"] = value; }
                }
 
-               public CompleteWizardStep CompleteStep
-               {
-                       get
-                       {
+               public CompleteWizardStep CompleteStep {
+                       get {
                                if (_completeWizardStep == null) {
                                        for (int i = 0; i < WizardSteps.Count; i++)
                                                if (WizardSteps [i] is CompleteWizardStep) {
@@ -167,15 +148,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string CompleteSuccessText
-               {
-                       get
-                       {
+               public virtual string CompleteSuccessText {
+                       get {
                                object o = ViewState ["CompleteSuccessText"];
                                return (o == null) ? Locale.GetText ("Your account has been successfully created.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("CompleteSuccessText");
                                else
@@ -183,10 +161,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public TableItemStyle CompleteSuccessTextStyle
-               {
-                       get
-                       {
+               public TableItemStyle CompleteSuccessTextStyle {
+                       get {
                                if (_completeSuccessTextStyle == null) {
                                        _completeSuccessTextStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -196,21 +172,17 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string ConfirmPassword
-               {
+               public virtual string ConfirmPassword {
                        get { return _confirmPassword; }
                }
 
                [LocalizableAttribute (true)]
-               public virtual string ConfirmPasswordCompareErrorMessage
-               {
-                       get
-                       {
+               public virtual string ConfirmPasswordCompareErrorMessage {
+                       get {
                                object o = ViewState ["ConfirmPasswordCompareErrorMessage"];
                                return (o == null) ? Locale.GetText ("The Password and Confirmation Password must match.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("ConfirmPasswordCompareErrorMessage");
                                else
@@ -219,15 +191,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string ConfirmPasswordLabelText
-               {
-                       get
-                       {
+               public virtual string ConfirmPasswordLabelText {
+                       get {
                                object o = ViewState ["ConfirmPasswordLabelText"];
                                return (o == null) ? Locale.GetText ("Confirm Password:") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("ConfirmPasswordLabelText");
                                else
@@ -236,15 +205,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string ConfirmPasswordRequiredErrorMessage
-               {
-                       get
-                       {
+               public virtual string ConfirmPasswordRequiredErrorMessage {
+                       get {
                                object o = ViewState ["ConfirmPasswordRequiredErrorMessage"];
                                return (o == null) ? Locale.GetText ("Confirm Password is required.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("ConfirmPasswordRequiredErrorMessage");
                                else
@@ -252,14 +218,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string ContinueButtonImageUrl
-               {
+               public virtual string ContinueButtonImageUrl {
                        get { return ViewState.GetString ("ContinueButtonImageUrl", String.Empty); }
                        set { ViewState ["ContinueButtonImageUrl"] = value; }
                }
 
-               public Style ContinueButtonStyle
-               {
+               public Style ContinueButtonStyle {
                        get {
                                if (_continueButtonStyle == null) {
                                        _continueButtonStyle = new Style ();
@@ -271,14 +235,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string ContinueButtonText
-               {
+               public virtual string ContinueButtonText {
                        get { return ViewState.GetString ("ContinueButtonText", "Continue"); }
                        set { ViewState ["ContinueButtonText"] = value; }
                }
 
-               public virtual ButtonType ContinueButtonType
-               {
+               public virtual ButtonType ContinueButtonType {
                        get {
                                object v = ViewState ["ContinueButtonType"];
                                return v != null ? (ButtonType) v : ButtonType.Button;
@@ -289,15 +251,12 @@ namespace System.Web.UI.WebControls
                }
 
                [ThemeableAttribute (false)]
-               public virtual string ContinueDestinationPageUrl
-               {
-                       get
-                       {
+               public virtual string ContinueDestinationPageUrl {
+                       get {
                                object o = ViewState ["ContinueDestinationPageUrl"];
                                return (o == null) ? "" : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("ContinueDestinationPageUrl");
                                else
@@ -305,14 +264,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string CreateUserButtonImageUrl
-               {
+               public virtual string CreateUserButtonImageUrl {
                        get { return ViewState.GetString ("CreateUserButtonImageUrl", String.Empty); }
                        set { ViewState ["CreateUserButtonImageUrl"] = value; }
                }
 
-               public Style CreateUserButtonStyle
-               {
+               public Style CreateUserButtonStyle {
                        get {
                                if (_createUserButtonStyle == null) {
                                        _createUserButtonStyle = new Style ();
@@ -324,27 +281,21 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string CreateUserButtonText
-               {
+               public virtual string CreateUserButtonText {
                        get { return ViewState.GetString ("CreateUserButtonText", "Create User"); }
                        set { ViewState ["CreateUserButtonText"] = value; }
                }
 
-               public virtual ButtonType CreateUserButtonType
-               {
+               public virtual ButtonType CreateUserButtonType {
                        get {
                                object v = ViewState ["CreateUserButtonType"];
                                return v != null ? (ButtonType) v : ButtonType.Button;
                        }
-                       set {
-                               ViewState ["CreateUserButtonType"] = value;
-                       }
+                       set { ViewState ["CreateUserButtonType"] = value; }
                }
 
-               public CreateUserWizardStep CreateUserStep
-               {
-                       get
-                       {
+               public CreateUserWizardStep CreateUserStep {
+                       get {
                                if (_createUserWizardStep == null) {
                                        for (int i = 0; i < WizardSteps.Count; i++)
                                                if (WizardSteps [i] is CreateUserWizardStep) {
@@ -359,24 +310,16 @@ namespace System.Web.UI.WebControls
                }
 
                [ThemeableAttribute (false)]
-               public virtual bool DisableCreatedUser
-               {
-                       get
-                       {
+               public virtual bool DisableCreatedUser {
+                       get {
                                object o = ViewState ["DisableCreatedUser"];
                                return (o == null) ? false : (bool) o;
                        }
-                       set
-                       {
-                               ViewState ["DisableCreatedUser"] = value;
-                       }
+                       set { ViewState ["DisableCreatedUser"] = value; }
                }
 
-               public override bool DisplaySideBar
-               {
-                       get {
-                               return ViewState.GetBool ("DisplaySideBar", false);
-                       }
+               public override bool DisplaySideBar {
+                       get { return ViewState.GetBool ("DisplaySideBar", false); }
                        set {
                                ViewState ["DisplaySideBar"] = value;
                                ChildControlsCreated = false;
@@ -384,15 +327,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string DuplicateEmailErrorMessage
-               {
-                       get
-                       {
+               public virtual string DuplicateEmailErrorMessage {
+                       get {
                                object o = ViewState ["DuplicateEmailErrorMessage"];
                                return (o == null) ? Locale.GetText ("The e-mail address that you entered is already in use. Please enter a different e-mail address.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("DuplicateEmailErrorMessage");
                                else
@@ -401,15 +341,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string DuplicateUserNameErrorMessage
-               {
-                       get
-                       {
+               public virtual string DuplicateUserNameErrorMessage {
+                       get {
                                object o = ViewState ["DuplicateUserNameErrorMessage"];
                                return (o == null) ? Locale.GetText ("Please enter a different user name.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("DuplicateUserNameErrorMessage");
                                else
@@ -417,15 +354,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string EditProfileIconUrl
-               {
-                       get
-                       {
+               public virtual string EditProfileIconUrl {
+                       get {
                                object o = ViewState ["EditProfileIconUrl"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("EditProfileIconUrl");
                                else
@@ -434,15 +368,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string EditProfileText
-               {
-                       get
-                       {
+               public virtual string EditProfileText {
+                       get {
                                object o = ViewState ["EditProfileText"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("EditProfileText");
                                else
@@ -450,15 +381,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string EditProfileUrl
-               {
-                       get
-                       {
+               public virtual string EditProfileUrl {
+                       get {
                                object o = ViewState ["EditProfileUrl"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("EditProfileUrl");
                                else
@@ -466,15 +394,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string Email
-               {
-                       get
-                       {
+               public virtual string Email {
+                       get {
                                object o = ViewState ["Email"];
                                return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("Email");
                                else
@@ -483,15 +408,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string EmailLabelText
-               {
-                       get
-                       {
+               public virtual string EmailLabelText {
+                       get {
                                object o = ViewState ["EmailLabelText"];
                                return (o == null) ? Locale.GetText ("E-mail:") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("EmailLabelText");
                                else
@@ -499,15 +421,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string EmailRegularExpression
-               {
-                       get
-                       {
+               public virtual string EmailRegularExpression {
+                       get {
                                object o = ViewState ["EmailRegularExpression"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("EmailRegularExpression");
                                else
@@ -515,15 +434,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string EmailRegularExpressionErrorMessage
-               {
-                       get
-                       {
+               public virtual string EmailRegularExpressionErrorMessage {
+                       get {
                                object o = ViewState ["EmailRegularExpressionErrorMessage"];
                                return (o == null) ? Locale.GetText ("Please enter a different e-mail.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("EmailRegularExpressionErrorMessage");
                                else
@@ -532,15 +448,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string EmailRequiredErrorMessage
-               {
-                       get
-                       {
+               public virtual string EmailRequiredErrorMessage {
+                       get {
                                object o = ViewState ["EmailRequiredErrorMessage"];
                                return (o == null) ? Locale.GetText ("E-mail is required.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("EmailRequiredErrorMessage");
                                else
@@ -548,10 +461,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public TableItemStyle ErrorMessageStyle
-               {
-                       get
-                       {
+               public TableItemStyle ErrorMessageStyle {
+                       get {
                                if (_errorMessageStyle == null) {
                                        _errorMessageStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -561,15 +472,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string HelpPageIconUrl
-               {
-                       get
-                       {
+               public virtual string HelpPageIconUrl {
+                       get {
                                object o = ViewState ["HelpPageIconUrl"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("HelpPageIconUrl");
                                else
@@ -578,15 +486,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string HelpPageText
-               {
-                       get
-                       {
+               public virtual string HelpPageText {
+                       get {
                                object o = ViewState ["HelpPageText"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("HelpPageText");
                                else
@@ -594,15 +499,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string HelpPageUrl
-               {
-                       get
-                       {
+               public virtual string HelpPageUrl {
+                       get {
                                object o = ViewState ["HelpPageUrl"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("HelpPageUrl");
                                else
@@ -610,10 +512,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public TableItemStyle HyperLinkStyle
-               {
-                       get
-                       {
+               public TableItemStyle HyperLinkStyle {
+                       get {
                                if (_hyperLinkStyle == null) {
                                        _hyperLinkStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -624,15 +524,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string InstructionText
-               {
-                       get
-                       {
+               public virtual string InstructionText {
+                       get {
                                object o = ViewState ["InstructionText"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("InstructionText");
                                else
@@ -640,10 +537,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public TableItemStyle InstructionTextStyle
-               {
-                       get
-                       {
+               public TableItemStyle InstructionTextStyle {
+                       get {
                                if (_instructionTextStyle == null) {
                                        _instructionTextStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -654,15 +549,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string InvalidAnswerErrorMessage
-               {
-                       get
-                       {
+               public virtual string InvalidAnswerErrorMessage {
+                       get {
                                object o = ViewState ["InvalidAnswerErrorMessage"];
                                return (o == null) ? Locale.GetText ("Please enter a different security answer.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("InvalidAnswerErrorMessage");
                                else
@@ -671,15 +563,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string InvalidEmailErrorMessage
-               {
-                       get
-                       {
+               public virtual string InvalidEmailErrorMessage {
+                       get {
                                object o = ViewState ["InvalidEmailErrorMessage"];
                                return (o == null) ? Locale.GetText ("Please enter a valid e-mail address.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("InvalidEmailErrorMessage");
                                else
@@ -689,15 +578,12 @@ namespace System.Web.UI.WebControls
 
                [MonoTODO ("take the values from membership provider")]
                [LocalizableAttribute (true)]
-               public virtual string InvalidPasswordErrorMessage
-               {
-                       get
-                       {
+               public virtual string InvalidPasswordErrorMessage {
+                       get {
                                object o = ViewState ["InvalidPasswordErrorMessage"];
                                return (o == null) ? Locale.GetText ("Password length minimum: {0}. Non-alphanumeric characters required: {1}.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("InvalidPasswordErrorMessage");
                                else
@@ -706,15 +592,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string InvalidQuestionErrorMessage
-               {
-                       get
-                       {
+               public virtual string InvalidQuestionErrorMessage {
+                       get {
                                object o = ViewState ["InvalidQuestionErrorMessage"];
                                return (o == null) ? Locale.GetText ("Please enter a different security question.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("InvalidQuestionErrorMessage");
                                else
@@ -722,10 +605,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public TableItemStyle LabelStyle
-               {
-                       get
-                       {
+               public TableItemStyle LabelStyle {
+                       get {
                                if (_labelStyle == null) {
                                        _labelStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -736,15 +617,12 @@ namespace System.Web.UI.WebControls
                }
 
                [ThemeableAttribute (false)]
-               public virtual bool LoginCreatedUser
-               {
-                       get
-                       {
+               public virtual bool LoginCreatedUser {
+                       get {
                                object o = ViewState ["LoginCreatedUser"];
                                return (o == null) ? true : (bool) o;
                        }
-                       set
-                       {
+                       set {
                                ViewState ["LoginCreatedUser"] = value;
                        }
                }
@@ -762,15 +640,12 @@ namespace System.Web.UI.WebControls
                }
 
                [ThemeableAttribute (false)]
-               public virtual string MembershipProvider
-               {
-                       get
-                       {
+               public virtual string MembershipProvider {
+                       get {
                                object o = ViewState ["MembershipProvider"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("MembershipProvider");
                                else
@@ -780,10 +655,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               internal virtual MembershipProvider MembershipProviderInternal
-               {
-                       get
-                       {
+               internal virtual MembershipProvider MembershipProviderInternal {
+                       get {
                                if (_provider == null)
                                        InitMemberShipProvider ();
 
@@ -791,15 +664,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string Password
-               {
+               public virtual string Password {
                        get { return _password; }
                }
 
-               public TableItemStyle PasswordHintStyle
-               {
-                       get
-                       {
+               public TableItemStyle PasswordHintStyle {
+                       get {
                                if (_passwordHintStyle == null) {
                                        _passwordHintStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -810,15 +680,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string PasswordHintText
-               {
-                       get
-                       {
+               public virtual string PasswordHintText {
+                       get {
                                object o = ViewState ["PasswordHintText"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("PasswordHintText");
                                else
@@ -827,15 +694,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string PasswordLabelText
-               {
-                       get
-                       {
+               public virtual string PasswordLabelText {
+                       get {
                                object o = ViewState ["PasswordLabelText"];
                                return (o == null) ? Locale.GetText ("Password:") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("PasswordLabelText");
                                else
@@ -843,15 +707,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string PasswordRegularExpression
-               {
-                       get
-                       {
+               public virtual string PasswordRegularExpression {
+                       get {
                                object o = ViewState ["PasswordRegularExpression"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("PasswordRegularExpression");
                                else
@@ -859,15 +720,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string PasswordRegularExpressionErrorMessage
-               {
-                       get
-                       {
+               public virtual string PasswordRegularExpressionErrorMessage {
+                       get {
                                object o = ViewState ["PasswordRegularExpressionErrorMessage"];
                                return (o == null) ? Locale.GetText ("Please enter a different password.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("PasswordRegularExpressionErrorMessage");
                                else
@@ -876,15 +734,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string PasswordRequiredErrorMessage
-               {
-                       get
-                       {
+               public virtual string PasswordRequiredErrorMessage {
+                       get {
                                object o = ViewState ["PasswordRequiredErrorMessage"];
                                return (o == null) ? Locale.GetText ("Password is required.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("PasswordRequiredErrorMessage");
                                else
@@ -894,15 +749,12 @@ namespace System.Web.UI.WebControls
 
                [LocalizableAttribute (true)]
                [ThemeableAttribute (false)]
-               public virtual string Question
-               {
-                       get
-                       {
+               public virtual string Question {
+                       get {
                                object o = ViewState ["Question"];
                                return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("Question");
                                else
@@ -911,15 +763,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string QuestionLabelText
-               {
-                       get
-                       {
+               public virtual string QuestionLabelText {
+                       get {
                                object o = ViewState ["QuestionLabelText"];
                                return (o == null) ? Locale.GetText ("Security Question:") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("QuestionLabelText");
                                else
@@ -928,15 +777,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string QuestionRequiredErrorMessage
-               {
-                       get
-                       {
+               public virtual string QuestionRequiredErrorMessage {
+                       get {
                                object o = ViewState ["QuestionRequiredErrorMessage"];
                                return (o == null) ? Locale.GetText ("Security question is required.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("QuestionRequiredErrorMessage");
                                else
@@ -945,29 +791,23 @@ namespace System.Web.UI.WebControls
                }
 
                [ThemeableAttribute (false)]
-               public virtual bool RequireEmail
-               {
-                       get
-                       {
+               public virtual bool RequireEmail {
+                       get {
                                object o = ViewState ["RequireEmail"];
                                return (o == null) ? true : (bool) o;
                        }
-                       set
-                       {
+                       set {
                                ViewState ["RequireEmail"] = value;
                        }
                }
 
                [MonoTODO ("doesnt work")]
-               public override string SkipLinkText
-               {
-                       get
-                       {
+               public override string SkipLinkText {
+                       get {
                                object o = ViewState ["SkipLinkText"];
-                               return (o == null) ? "" : (string) o;
+                               return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("SkipLinkText");
                                else
@@ -975,10 +815,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public Style TextBoxStyle
-               {
-                       get
-                       {
+               public Style TextBoxStyle {
+                       get {
                                if (_textBoxStyle == null) {
                                        _textBoxStyle = new Style ();
                                        if (IsTrackingViewState)
@@ -988,10 +826,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public TableItemStyle TitleTextStyle
-               {
-                       get
-                       {
+               public TableItemStyle TitleTextStyle {
+                       get {
                                if (_titleTextStyle == null) {
                                        _titleTextStyle = new TableItemStyle ();
                                        if (IsTrackingViewState)
@@ -1002,15 +838,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string UnknownErrorMessage
-               {
-                       get
-                       {
+               public virtual string UnknownErrorMessage {
+                       get {
                                object o = ViewState ["UnknownErrorMessage"];
                                return (o == null) ? Locale.GetText ("Your account was not created. Please try again.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("UnknownErrorMessage");
                                else
@@ -1018,15 +851,12 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public virtual string UserName
-               {
-                       get
-                       {
+               public virtual string UserName {
+                       get {
                                object o = ViewState ["UserName"];
                                return (o == null) ? String.Empty : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("UserName");
                                else
@@ -1035,15 +865,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string UserNameLabelText
-               {
-                       get
-                       {
+               public virtual string UserNameLabelText {
+                       get {
                                object o = ViewState ["UserNameLabelText"];
                                return (o == null) ? Locale.GetText ("User Name:") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("UserNameLabelText");
                                else
@@ -1052,15 +879,12 @@ namespace System.Web.UI.WebControls
                }
 
                [LocalizableAttribute (true)]
-               public virtual string UserNameRequiredErrorMessage
-               {
-                       get
-                       {
+               public virtual string UserNameRequiredErrorMessage {
+                       get {
                                object o = ViewState ["UserNameRequiredErrorMessage"];
                                return (o == null) ? Locale.GetText ("User Name is required.") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("UserNameRequiredErrorMessage");
                                else
@@ -1068,10 +892,8 @@ namespace System.Web.UI.WebControls
                        }
                }
 
-               public Style ValidatorTextStyle
-               {
-                       get
-                       {
+               public Style ValidatorTextStyle {
+                       get {
                                if (_validatorTextStyle == null) {
                                        _validatorTextStyle = new Style ();
                                        if (IsTrackingViewState)
@@ -1082,8 +904,7 @@ namespace System.Web.UI.WebControls
                }
 
                [ThemeableAttribute (false)]
-               public override WizardStepCollection WizardSteps
-               {
+               public override WizardStepCollection WizardSteps {
                        get { return base.WizardSteps; }
                }
 
@@ -1091,43 +912,36 @@ namespace System.Web.UI.WebControls
 
                #region Protected Properties
 
-               protected internal bool QuestionAndAnswerRequired
-               {
+               protected internal bool QuestionAndAnswerRequired {
                        get { return MembershipProviderInternal.RequiresQuestionAndAnswer; }
                }
 
-               public event EventHandler ContinueButtonClick
-               {
+               public event EventHandler ContinueButtonClick {
                        add { Events.AddHandler (ContinueButtonClickEvent, value); }
                        remove { Events.RemoveHandler (ContinueButtonClickEvent, value); }
                }
 
-               public event EventHandler CreatedUser
-               {
+               public event EventHandler CreatedUser {
                        add { Events.AddHandler (CreatedUserEvent, value); }
                        remove { Events.RemoveHandler (CreatedUserEvent, value); }
                }
 
-               public event CreateUserErrorEventHandler CreateUserError
-               {
+               public event CreateUserErrorEventHandler CreateUserError {
                        add { Events.AddHandler (CreateUserErrorEvent, value); }
                        remove { Events.RemoveHandler (CreateUserErrorEvent, value); }
                }
 
-               public event LoginCancelEventHandler CreatingUser
-               {
+               public event LoginCancelEventHandler CreatingUser {
                        add { Events.AddHandler (CreatingUserEvent, value); }
                        remove { Events.RemoveHandler (CreatingUserEvent, value); }
                }
 
-               public event MailMessageEventHandler SendingMail
-               {
+               public event MailMessageEventHandler SendingMail {
                        add { Events.AddHandler (SendingMailEvent, value); }
                        remove { Events.RemoveHandler (SendingMailEvent, value); }
                }
 
-               public event SendMailErrorEventHandler SendMailError
-               {
+               public event SendMailErrorEventHandler SendMailError {
                        add { Events.AddHandler (SendMailErrorEvent, value); }
                        remove { Events.RemoveHandler (SendMailErrorEvent, value); }
                }
@@ -1139,23 +953,19 @@ namespace System.Web.UI.WebControls
 
                internal override void InstantiateTemplateStep (TemplatedWizardStep step)
                {
-                       if (step is CreateUserWizardStep) {
+                       if (step is CreateUserWizardStep)
                                InstantiateCreateUserWizardStep ((CreateUserWizardStep) step);
-                       }
-                       else if (step is CompleteWizardStep) {
+                       else if (step is CompleteWizardStep)
                                InstantiateCompleteWizardStep ((CompleteWizardStep) step);
-                       }
-                       else {
+                       else
                                base.InstantiateTemplateStep (step);
-                       }
                }
 
                void InstantiateCompleteWizardStep (CompleteWizardStep step)
                {
                        CompleteStepContainer contentTemplateContainer = new CompleteStepContainer (this);
-                       if (step.ContentTemplate != null) {
+                       if (step.ContentTemplate != null)
                                step.ContentTemplate.InstantiateIn (contentTemplateContainer.InnerCell);
-                       }
                        else {
                                new CompleteStepTemplate (this).InstantiateIn (contentTemplateContainer.InnerCell);
                                contentTemplateContainer.ConfirmDefaultTemplate ();
@@ -1176,9 +986,8 @@ namespace System.Web.UI.WebControls
                void InstantiateCreateUserWizardStep (CreateUserWizardStep step)
                {
                        CreateUserStepContainer contentTemplateContainer = new CreateUserStepContainer (this);
-                       if (step.ContentTemplate != null) {
+                       if (step.ContentTemplate != null)
                                step.ContentTemplate.InstantiateIn (contentTemplateContainer.InnerCell);
-                       }
                        else {
                                new CreateUserStepTemplate (this).InstantiateIn (contentTemplateContainer.InnerCell);
                                contentTemplateContainer.ConfirmDefaultTemplate ();
@@ -1190,9 +999,8 @@ namespace System.Web.UI.WebControls
                        step.Controls.Add (contentTemplateContainer);
 
                        CreateUserNavigationContainer customNavigationTemplateContainer = new CreateUserNavigationContainer (this);
-                       if (step.CustomNavigationTemplate != null) {
+                       if (step.CustomNavigationTemplate != null)
                                step.CustomNavigationTemplate.InstantiateIn (customNavigationTemplateContainer);
-                       }
                        else {
                                new CreateUserStepNavigationTemplate (this).InstantiateIn (customNavigationTemplateContainer);
                                customNavigationTemplateContainer.ConfirmDefaultTemplate ();
@@ -1202,8 +1010,7 @@ namespace System.Web.UI.WebControls
                        step.CustomNavigationTemplateContainer = customNavigationTemplateContainer;
                }
                
-               internal override ITemplate SideBarItemTemplate
-               {
+               internal override ITemplate SideBarItemTemplate {
                        get { return new SideBarLabelTemplate (this); }
                }
 
@@ -1286,19 +1093,20 @@ namespace System.Web.UI.WebControls
                        return base.OnBubbleEvent (source, e);
                }
 
-               void ProcessContinueEvent () {
+               void ProcessContinueEvent ()
+               {
                        OnContinueButtonClick (EventArgs.Empty);
 
-                       if (ContinueDestinationPageUrl.Length > 0) {
+                       if (ContinueDestinationPageUrl.Length > 0)
                                Context.Response.Redirect (ContinueDestinationPageUrl);
-                       }
                }
 
                protected virtual void OnContinueButtonClick (EventArgs e)
                {
                        if (Events != null) {
                                EventHandler eh = (EventHandler) Events [ContinueButtonClickEvent];
-                               if (eh != null) eh (this, e);
+                               if (eh != null)
+                                       eh (this, e);
                        }
                }
 
@@ -1306,7 +1114,8 @@ namespace System.Web.UI.WebControls
                {
                        if (Events != null) {
                                EventHandler eh = (EventHandler) Events [CreatedUserEvent];
-                               if (eh != null) eh (this, e);
+                               if (eh != null)
+                                       eh (this, e);
                        }
                }
 
@@ -1314,7 +1123,8 @@ namespace System.Web.UI.WebControls
                {
                        if (Events != null) {
                                CreateUserErrorEventHandler eh = (CreateUserErrorEventHandler) Events [CreateUserErrorEvent];
-                               if (eh != null) eh (this, e);
+                               if (eh != null)
+                                       eh (this, e);
                        }
                }
 
@@ -1322,7 +1132,8 @@ namespace System.Web.UI.WebControls
                {
                        if (Events != null) {
                                LoginCancelEventHandler eh = (LoginCancelEventHandler) Events [CreatingUserEvent];
-                               if (eh != null) eh (this, e);
+                               if (eh != null)
+                                       eh (this, e);
                        }
                }
 
@@ -1348,7 +1159,8 @@ namespace System.Web.UI.WebControls
                {
                        if (Events != null) {
                                MailMessageEventHandler eh = (MailMessageEventHandler) Events [SendingMailEvent];
-                               if (eh != null) eh (this, e);
+                               if (eh != null)
+                                       eh (this, e);
                        }
                }
 
@@ -1710,7 +1522,8 @@ namespace System.Web.UI.WebControls
 
                        #region ITemplate Members
 
-                       public void InstantiateIn (Control container) {
+                       public void InstantiateIn (Control container)
+                       {
                                Table t = new Table ();
                                t.CellPadding = 5;
                                t.CellSpacing = 5;
@@ -1803,22 +1616,19 @@ namespace System.Web.UI.WebControls
                                get { return FindControl ("ErrorMessage") as ITextControl; }
                        }
 
-                       protected override void UpdateState () {
+                       protected override void UpdateState ()
+                       {
                                // Row #0 - title
-                               if (String.IsNullOrEmpty (_createUserWizard.CreateUserStep.Title)) {
+                               if (String.IsNullOrEmpty (_createUserWizard.CreateUserStep.Title))
                                        ((Table) InnerCell.Controls [0]).Rows [0].Visible = false;
-                               }
-                               else {
+                               else
                                        ((Table) InnerCell.Controls [0]).Rows [0].Cells [0].Text = _createUserWizard.CreateUserStep.Title;
-                               }
 
                                // Row #1 - InstructionText
-                               if (String.IsNullOrEmpty (_createUserWizard.InstructionText)) {
+                               if (String.IsNullOrEmpty (_createUserWizard.InstructionText))
                                        ((Table) InnerCell.Controls [0]).Rows [1].Visible = false;
-                               }
-                               else {
+                               else
                                        ((Table) InnerCell.Controls [0]).Rows [1].Cells [0].Text = _createUserWizard.InstructionText;
-                               }
 
                                // Row #2
                                Label UserNameLabel = (Label) ((Table) InnerCell.Controls [0]).Rows [2].Cells [0].Controls [0];
@@ -1832,8 +1642,7 @@ namespace System.Web.UI.WebControls
                                        ((Table) InnerCell.Controls [0]).Rows [3].Visible = false;
                                        ((Table) InnerCell.Controls [0]).Rows [4].Visible = false;
                                        ((Table) InnerCell.Controls [0]).Rows [5].Visible = false;
-                               }
-                               else {
+                               } else {
                                        // Row #3
                                        Label PasswordLabel = (Label) ((Table) InnerCell.Controls [0]).Rows [3].Cells [0].Controls [0];
                                        PasswordLabel.Text = _createUserWizard.PasswordLabelText;
@@ -1843,12 +1652,10 @@ namespace System.Web.UI.WebControls
                                        PasswordRequired.ToolTip = _createUserWizard.PasswordRequiredErrorMessage;
 
                                        // Row #4
-                                       if (String.IsNullOrEmpty (_createUserWizard.PasswordHintText)) {
+                                       if (String.IsNullOrEmpty (_createUserWizard.PasswordHintText))
                                                ((Table) InnerCell.Controls [0]).Rows [4].Visible = false;
-                                       }
-                                       else {
+                                       else
                                                ((Table) InnerCell.Controls [0]).Rows [4].Cells [1].Text = _createUserWizard.PasswordHintText;
-                                       }
 
                                        // Row #5
                                        Label ConfirmPasswordLabel = (Label) ((Table) InnerCell.Controls [0]).Rows [5].Cells [0].Controls [0];
@@ -1867,10 +1674,8 @@ namespace System.Web.UI.WebControls
                                        RequiredFieldValidator EmailRequired = (RequiredFieldValidator) FindControl ("EmailRequired");
                                        EmailRequired.ErrorMessage = _createUserWizard.EmailRequiredErrorMessage;
                                        EmailRequired.ToolTip = _createUserWizard.EmailRequiredErrorMessage;
-                               }
-                               else {
+                               } else
                                        ((Table) InnerCell.Controls [0]).Rows [6].Visible = false;
-                               }
 
                                if (_createUserWizard.QuestionAndAnswerRequired) {
                                        // Row #7
@@ -1888,25 +1693,22 @@ namespace System.Web.UI.WebControls
                                        RequiredFieldValidator AnswerRequired = (RequiredFieldValidator) FindControl ("AnswerRequired");
                                        AnswerRequired.ErrorMessage = _createUserWizard.AnswerRequiredErrorMessage;
                                        AnswerRequired.ToolTip = _createUserWizard.AnswerRequiredErrorMessage;
-                               }
-                               else {
+                               } else {
                                        ((Table) InnerCell.Controls [0]).Rows [7].Visible = false;
                                        ((Table) InnerCell.Controls [0]).Rows [8].Visible = false;
                                }
 
                                // Row #9
-                               if (_createUserWizard.AutoGeneratePassword) {
+                               if (_createUserWizard.AutoGeneratePassword)
                                        ((Table) InnerCell.Controls [0]).Rows [9].Visible = false;
-                               }
                                else {
                                        CompareValidator PasswordCompare = (CompareValidator) FindControl ("PasswordCompare");
                                        PasswordCompare.ErrorMessage = _createUserWizard.ConfirmPasswordCompareErrorMessage;
                                }
 
                                // Row #10
-                               if (_createUserWizard.AutoGeneratePassword || String.IsNullOrEmpty (_createUserWizard.PasswordRegularExpression)) {
+                               if (_createUserWizard.AutoGeneratePassword || String.IsNullOrEmpty (_createUserWizard.PasswordRegularExpression))
                                        ((Table) InnerCell.Controls [0]).Rows [10].Visible = false;
-                               }
                                else {
                                        RegularExpressionValidator PasswordRegEx = (RegularExpressionValidator) FindControl ("PasswordRegEx");
                                        PasswordRegEx.ValidationExpression = _createUserWizard.PasswordRegularExpression;
@@ -1914,9 +1716,8 @@ namespace System.Web.UI.WebControls
                                }
 
                                // Row #11
-                               if (!_createUserWizard.RequireEmail || String.IsNullOrEmpty (_createUserWizard.EmailRegularExpression)) {
+                               if (!_createUserWizard.RequireEmail || String.IsNullOrEmpty (_createUserWizard.EmailRegularExpression))
                                        ((Table) InnerCell.Controls [0]).Rows [11].Visible = false;
-                               }
                                else {
                                        RegularExpressionValidator EmailRegEx = (RegularExpressionValidator) FindControl ("EmailRegEx");
                                        EmailRegEx.ErrorMessage = _createUserWizard.EmailRegularExpressionErrorMessage;
@@ -1924,16 +1725,14 @@ namespace System.Web.UI.WebControls
                                }
 
                                // Row #12
-                               if (String.IsNullOrEmpty (ErrorMessageLabel.Text)) {
+                               if (String.IsNullOrEmpty (ErrorMessageLabel.Text))
                                        ((Table) InnerCell.Controls [0]).Rows [12].Visible = false;
-                               }
 
                                // Row #13
                                // HelpPageIconUrl
                                Image img = (Image) ((Table) InnerCell.Controls [0]).Rows [13].Cells [0].Controls [0];
-                               if (String.IsNullOrEmpty (_createUserWizard.HelpPageIconUrl)) {
+                               if (String.IsNullOrEmpty (_createUserWizard.HelpPageIconUrl))
                                        img.Visible = false;
-                               }
                                else {
                                        img.ImageUrl = _createUserWizard.HelpPageIconUrl;
                                        img.AlternateText = _createUserWizard.HelpPageText;
@@ -1941,9 +1740,8 @@ namespace System.Web.UI.WebControls
 
                                // HelpPageText
                                HyperLink link = (HyperLink) ((Table) InnerCell.Controls [0]).Rows [13].Cells [0].Controls [1];
-                               if (String.IsNullOrEmpty (_createUserWizard.HelpPageText)) {
+                               if (String.IsNullOrEmpty (_createUserWizard.HelpPageText))
                                        link.Visible = false;
-                               }
                                else {
                                        link.Text = _createUserWizard.HelpPageText;
                                        link.NavigateUrl = _createUserWizard.HelpPageUrl;
@@ -1986,7 +1784,8 @@ namespace System.Web.UI.WebControls
 
                        #region ITemplate Members
 
-                       TableRow CreateRow (Control c0, Control c1, Control c2, Style s0, Style s1) {
+                       TableRow CreateRow (Control c0, Control c1, Control c2, Style s0, Style s1)
+                       {
                                TableRow row = new TableRow ();
                                TableCell cell0 = new TableCell ();
                                TableCell cell1 = new TableCell ();
@@ -2006,8 +1805,7 @@ namespace System.Web.UI.WebControls
                                                _createUserWizard.RegisterApplyStyle (cell1, s1);
 
                                        row.Controls.Add (cell1);
-                               }
-                               else {
+                               } else {
                                        cell0.ColumnSpan = 2;
                                        cell0.HorizontalAlign = HorizontalAlign.Center;
                                        if (s0 != null)
@@ -2016,7 +1814,8 @@ namespace System.Web.UI.WebControls
                                return row;
                        }
 
-                       public void InstantiateIn (Control container) {
+                       public void InstantiateIn (Control container)
+                       {
                                Table table = new Table ();
                                table.ControlStyle.Width = Unit.Percentage (100);
                                table.ControlStyle.Height = Unit.Percentage (100);
@@ -2068,7 +1867,7 @@ namespace System.Web.UI.WebControls
                                table.Controls.Add (CreateRow (PasswordLabel, Password, PasswordRequired, _createUserWizard.LabelStyle, null));
 
                                // Row #4
-                               table.Controls.Add (CreateRow (new LiteralControl (""), new LiteralControl (""), new LiteralControl (""), null, _createUserWizard.PasswordHintStyle));
+                               table.Controls.Add (CreateRow (new LiteralControl (String.Empty), new LiteralControl (String.Empty), new LiteralControl (String.Empty), null, _createUserWizard.PasswordHintStyle));
 
                                // Row #5
                                TextBox ConfirmPassword = new TextBox ();
@@ -2219,29 +2018,24 @@ namespace System.Web.UI.WebControls
                        protected override void UpdateState ()
                        {
                                // title
-                               if (String.IsNullOrEmpty (_createUserWizard.CompleteStep.Title)) {
+                               if (String.IsNullOrEmpty (_createUserWizard.CompleteStep.Title))
                                        ((Table) InnerCell.Controls [0]).Rows [0].Visible = false;
-                               }
-                               else {
+                               else
                                        ((Table) InnerCell.Controls [0]).Rows [0].Cells [0].Text = _createUserWizard.CompleteStep.Title;
-                               }
 
                                // CompleteSuccessText
-                               if (String.IsNullOrEmpty (_createUserWizard.CompleteSuccessText)) {
+                               if (String.IsNullOrEmpty (_createUserWizard.CompleteSuccessText))
                                        ((Table) InnerCell.Controls [0]).Rows [1].Visible = false;
-                               }
-                               else {
+                               else
                                        ((Table) InnerCell.Controls [0]).Rows [1].Cells [0].Text = _createUserWizard.CompleteSuccessText;
-                               }
 
                                // ContinueButton
                                UpdateNavButtonState ("ContinueButton" + _createUserWizard.ContinueButtonType, _createUserWizard.ContinueButtonText, _createUserWizard.ContinueButtonImageUrl, _createUserWizard.ContinueButtonStyle);
 
                                // EditProfileIconUrl
                                Image img = (Image) ((Table) InnerCell.Controls [0]).Rows [3].Cells [0].Controls [0];
-                               if (String.IsNullOrEmpty (_createUserWizard.EditProfileIconUrl)) {
+                               if (String.IsNullOrEmpty (_createUserWizard.EditProfileIconUrl))
                                        img.Visible = false;
-                               }
                                else {
                                        img.ImageUrl = _createUserWizard.EditProfileIconUrl;
                                        img.AlternateText = _createUserWizard.EditProfileText;
@@ -2249,9 +2043,8 @@ namespace System.Web.UI.WebControls
 
                                // EditProfileText
                                HyperLink link = (HyperLink) ((Table) InnerCell.Controls [0]).Rows [3].Cells [0].Controls [1];
-                               if (String.IsNullOrEmpty (_createUserWizard.EditProfileText)) {
+                               if (String.IsNullOrEmpty (_createUserWizard.EditProfileText))
                                        link.Visible = false;
-                               }
                                else {
                                        link.Text = _createUserWizard.EditProfileText;
                                        link.NavigateUrl = _createUserWizard.EditProfileUrl;
@@ -2343,5 +2136,3 @@ namespace System.Web.UI.WebControls
                }
        }
 }
-
-#endif
index 117baf1bb5282634ca629487818543b78b4e20d6..b063b827f956db32453cb67c7fe587f89784fda9 100644 (file)
@@ -24,8 +24,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using System;
 using System.Web;
 using System.Web.UI;
@@ -42,26 +40,18 @@ namespace System.Web.UI.WebControls
                }
 
                [DefaultValueAttribute (false)]
-               public override bool AllowReturn
-               {
-                       get {
-                               return ViewState.GetBool ("AllowReturn", false);
-                       }
-                       set {
-                               ViewState ["AllowReturn"] = value;
-                       }
+               public override bool AllowReturn {
+                       get { return ViewState.GetBool ("AllowReturn", false); }
+                       set { ViewState ["AllowReturn"] = value; }
                }
 
                [LocalizableAttribute (true)]
-               public override string Title
-               {
-                       get
-                       {
+               public override string Title {
+                       get {
                                object o = ViewState ["TitleText"];
                                return (o == null) ? Locale.GetText ("Sign Up for Your New Account") : (string) o;
                        }
-                       set
-                       {
+                       set {
                                if (value == null)
                                        ViewState.Remove ("TitleText");
                                else
@@ -72,12 +62,10 @@ namespace System.Web.UI.WebControls
                // MSDN: If you attempt to change the StepType property to any value other than the Auto value of the WizardStepType enumeration, an 
                // InvalidOperationException will be thrown.
                [ThemeableAttribute (false)]
-               public override WizardStepType StepType
-               {
+               public override WizardStepType StepType {
                        get { return WizardStepType.Auto; }
                        set { throw new InvalidOperationException (); }
                }
        }
 }
 
-#endif
index e4f0581d8936b6bcc24d707fc83242a1783f3a24..a8720a9e4944f95a29c61130a57adac8d3fb060a 100644 (file)
@@ -17,7 +17,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+// Copyright (c) 2005-2010 Novell, Inc. (http://www.novell.com)
 //
 // Authors:
 //     Peter Bartok    (pbartok@novell.com)
 using System.ComponentModel;
 using System.Security.Permissions;
 
-namespace System.Web.UI.WebControls {
+namespace System.Web.UI.WebControls
+{
        // CAS
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        // attributes
        [DefaultEvent("ServerValidate")]
-#if NET_2_0
        [ToolboxData("<{0}:CustomValidator runat=\"server\" ErrorMessage=\"CustomValidator\"></{0}:CustomValidator>")]
-#else
-       [ToolboxData("<{0}:CustomValidator runat=server ErrorMessage=\"CustomValidator\"></{0}:CustomValidator>")]
-#endif
-       public class CustomValidator : BaseValidator {
+       public class CustomValidator : BaseValidator
+       {
                static readonly object serverValidateEvent = new object ();
 
                EventHandlerList events = new EventHandlerList ();
@@ -46,7 +44,7 @@ namespace System.Web.UI.WebControls {
                #region Events
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-                       public event ServerValidateEventHandler ServerValidate {
+               public event ServerValidateEventHandler ServerValidate {
                        add { events.AddHandler (serverValidateEvent, value); }
                        remove { events.RemoveHandler (serverValidateEvent, value); }
                }
@@ -54,7 +52,8 @@ namespace System.Web.UI.WebControls {
                #endregion      // Events
 
                #region Public Constructors
-               public CustomValidator() {
+               public CustomValidator()
+               {
                }
                #endregion      // Public Constructors
 
@@ -62,68 +61,59 @@ namespace System.Web.UI.WebControls {
                [DefaultValue("")]
                [WebSysDescription ("")]
                [WebCategory ("Behavior")]
-#if NET_2_0
                [Themeable (false)]
-#endif
                public string ClientValidationFunction {
-                       get { return ViewState.GetString("ClientValidationFunction", ""); }
+                       get { return ViewState.GetString("ClientValidationFunction", String.Empty); }
                        set { ViewState["ClientValidationFunction"] = value; }
                }
 
-#if NET_2_0
                [Themeable (false)]
                [DefaultValue (false)]
                public bool ValidateEmptyText {
                        get { return ViewState.GetBool ("ValidateEmptyText", false); }
                        set { ViewState ["ValidateEmptyText"] = value; }
                }
-#endif
                #endregion      // Public Instance Properties
 
                #region Public Instance Methods
-               protected override void AddAttributesToRender(HtmlTextWriter writer) {
+               protected override void AddAttributesToRender (HtmlTextWriter writer)
+               {
                        base.AddAttributesToRender (writer);
 
                        if (base.RenderUplevel) {
                                string s;
-                               
-#if NET_2_0
+
                                RegisterExpandoAttribute (ClientID, "evaluationfunction", "CustomValidatorEvaluateIsValid");
                                if (ValidateEmptyText)
                                        RegisterExpandoAttribute (ClientID, "validateemptytext", "true");
                                s = ClientValidationFunction;
                                if (!String.IsNullOrEmpty (s))
                                        RegisterExpandoAttribute (ClientID, "clientvalidationfunction", s, true);
-#else
-                               writer.AddAttribute ("evaluationfunction", "CustomValidatorEvaluateIsValid", false);
-
-                               s = ClientValidationFunction;
-                               if (s != String.Empty)
-                                       writer.AddAttribute("clientvalidationfunction", s);
-#endif
                        }
                }
 
                protected override bool ControlPropertiesValid ()
                {
-                       if (ControlToValidate == "")
+                       if (String.IsNullOrEmpty (ControlToValidate))
                                return true;
                        return base.ControlPropertiesValid ();
                }
 
-               protected override bool EvaluateIsValid() {
-                       if (ControlToValidate.Length > 0) {
-                               string value = GetControlValidationValue (ControlToValidate);
-#if NET_2_0
+               protected override bool EvaluateIsValid ()
+               {
+                       string controlToValidate = ControlToValidate;
+                       if (!String.IsNullOrEmpty (controlToValidate)) {
+                               string value = GetControlValidationValue (controlToValidate);
                                if (String.IsNullOrEmpty (value) && !ValidateEmptyText)
                                        return true;
-#endif
+
                                return OnServerValidate (value);
                        }
                        return OnServerValidate(string.Empty);
                }
 
-               protected virtual bool OnServerValidate(string value) {
+               protected virtual bool OnServerValidate (string value)
+               {
                        ServerValidateEventHandler eh = events [serverValidateEvent] as ServerValidateEventHandler;
                        if (eh != null) {
                                ServerValidateEventArgs e;