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