X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web%2FSystem.Web.UI.WebControls.WebParts%2FPersonalizableAttribute.cs;h=eeb69120205e5e69c80fd0877de66cabca26d2ae;hb=018e826d47309aeb3cf2e9883c034ddd86da2a16;hp=ad48f31795f62e1337cab8a7fa94c49b69da09c5;hpb=499ae57711e1d37676771f64c95456f5e541e49c;p=mono.git diff --git a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PersonalizableAttribute.cs b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PersonalizableAttribute.cs index ad48f31795f..eeb69120205 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PersonalizableAttribute.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls.WebParts/PersonalizableAttribute.cs @@ -27,7 +27,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. // -#if NET_2_0 using System; using System.Collections; using System.Collections.Generic; @@ -102,18 +101,6 @@ namespace System.Web.UI.WebControls.WebParts this.scope == attr.Scope); } - public static bool Equals (object objA, object objB) - { - PersonalizableAttribute attrA = objA as PersonalizableAttribute; - PersonalizableAttribute attrB = objB as PersonalizableAttribute; - - if (objA == null || objB == null) - return false; - return (attrA.IsPersonalizable == attrB.IsPersonalizable && - attrA.IsSensitive == attrB.IsSensitive && - attrA.Scope == attrB.Scope); - } - public override int GetHashCode () { return (this.isPersonalizable.GetHashCode () ^ @@ -125,15 +112,18 @@ namespace System.Web.UI.WebControls.WebParts { if (type == null) throw new ArgumentNullException ("type"); - - List ret = new List (); + PropertyInfo[] properties = type.GetProperties (); if (properties == null || properties.Length == 0) - return ret; + return new PropertyInfo [0]; + List ret = null; foreach (PropertyInfo pi in properties) - if (PropertyQualifies (pi)) + if (PropertyQualifies (pi)) { + if (ret == null) + ret = new List (); ret.Add (pi); + } return ret; } @@ -172,4 +162,3 @@ namespace System.Web.UI.WebControls.WebParts } } } -#endif