Author: igorz
Date: 2007-05-03 10:36:24 -0400 (Thu, 03 May 2007)
New Revision: 76623

Modified:
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/AggregateCacheDependency.cs
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs
   branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/ChangeLog
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ControlPropertyNameConverter.cs
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
   branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/ChangeLog
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs
   branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/PartialCachingControl.cs
   branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/TemplateControl.cs
   
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
   branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/XPathBinder.cs
   branches/mainsoft/gh20/mcs/class/System.Web/System.Web/BrowserCapabilities.cs
   branches/mainsoft/gh20/mcs/class/System.Web/System.Web/ChangeLog
Log:
merged r76621-76622

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web/BrowserCapabilities.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web/BrowserCapabilities.cs   
    2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web/BrowserCapabilities.cs   
    2007-05-03 14:36:24 UTC (rev 76623)
@@ -262,6 +262,19 @@
                                return browsers;
                        }
                }
+
+               public bool IsBrowser (string browserName) 
+               {
+                       foreach (string browser in Browsers) {
+                               if (0 == String.CompareOrdinal(browser, 
"Unknown")) {
+                                       continue;
+                               }
+                               if (0 == String.CompareOrdinal(browserName, 
browser)) {
+                                       return true;
+                               }
+                       }
+                       return false;
+               }
 #endif
                public bool CDF {
                        get {

Modified: branches/mainsoft/gh20/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- branches/mainsoft/gh20/mcs/class/System.Web/System.Web/ChangeLog    
2007-05-03 14:29:09 UTC (rev 76622)
+++ branches/mainsoft/gh20/mcs/class/System.Web/System.Web/ChangeLog    
2007-05-03 14:36:24 UTC (rev 76623)
@@ -1,3 +1,8 @@
+2007-05-03 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * BrowserCapabilities.cs:
+       added missing API.      
+
 2007-04-29 Igor Zelmanovich <[EMAIL PROTECTED]>
 
        * HttpContext.jvm.cs: Response.End() must abort thread if not async.    

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/AggregateCacheDependency.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/AggregateCacheDependency.cs
  2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/AggregateCacheDependency.cs
  2007-05-03 14:36:24 UTC (rev 76623)
@@ -40,7 +40,9 @@
                private List <CacheDependency> dependencies;
                
                public AggregateCacheDependency ()
-               {}
+               {
+                       FinishInit ();
+               }
 
                public void Add (params CacheDependency [] dependencies)
                {
@@ -63,7 +65,7 @@
                                base.Start = DateTime.UtcNow;
                        }
                        if (somethingChanged)
-                               base.SignalDependencyChanged ();
+                               base.NotifyDependencyChanged (this, null);
                }
 
                public override string GetUniqueID ()
@@ -88,3 +90,4 @@
 }
 #endif
 
+

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs
   2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs
   2007-05-03 14:36:24 UTC (rev 76623)
@@ -54,6 +54,7 @@
                bool hasChanged;
 #if NET_2_0
                bool used;
+               DateTime utcLastModified;
 #endif
                object locker = new object ();
                
@@ -122,6 +123,10 @@
                        if (dependency != null)
                                dependency.DependencyChanged += new 
EventHandler (OnChildDependencyChanged);
                        this.start = start;
+
+#if NET_2_0
+                       FinishInit ();
+#endif
                }
 
 #if NET_2_0
@@ -147,6 +152,9 @@
                        if (DateTime.Now < start)
                                return;
                        hasChanged = true;
+#if NET_2_0
+                       utcLastModified = DateTime.UtcNow;
+#endif
                        DisposeWatchers ();
                        
                        if (cache != null)
@@ -164,8 +172,17 @@
                                watchers = null;
                        }
                }
+
                public void Dispose ()
                {
+                       DependencyDispose ();
+               }
+
+#if NET_2_0
+               protected virtual
+#endif
+               void DependencyDispose () 
+               {
                        DisposeWatchers ();
                        if (dependency != null)
                                dependency.DependencyChanged -= new 
EventHandler (OnChildDependencyChanged);
@@ -181,6 +198,11 @@
                }
                
 #if NET_2_0
+               protected internal void FinishInit () 
+               {
+                       utcLastModified = DateTime.UtcNow;
+               }
+
                internal bool IsUsed {
                        get { return used; }
                }
@@ -189,6 +211,18 @@
                        get { return start; }
                        set { start = value; }
                }
+
+               public DateTime UtcLastModified {
+                       get {
+                               return utcLastModified;
+                       }
+               }
+
+               protected void SetUtcLastModified (DateTime utcLastModified) 
+               {
+                       this.utcLastModified = utcLastModified;
+               }
+
 #endif
                
                public bool HasChanged {
@@ -214,24 +248,28 @@
                        }
                }
                
-               void OnChildDependencyChanged (object o, EventArgs a)
+               void OnChildDependencyChanged (object o, EventArgs e)
                {
                        hasChanged = true;
-                       OnDependencyChanged ();
+                       OnDependencyChanged (o, e);
                }
                
-               void OnDependencyChanged ()
+               void OnDependencyChanged (object sender, EventArgs e)
                {
                        if (DependencyChanged != null)
-                               DependencyChanged (this, null);
+                               DependencyChanged (sender, e);
                }
                
 #if NET_2_0
-               internal void SignalDependencyChanged ()
+               protected
+#else
+               internal
+#endif
+               void NotifyDependencyChanged (object sender, EventArgs e) 
                {
-                       OnDependencyChanged ();
+                       OnDependencyChanged (sender, e);
                }
-#endif
+
                internal event EventHandler DependencyChanged;
        }
 }

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/ChangeLog
===================================================================
--- branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/ChangeLog    
2007-05-03 14:29:09 UTC (rev 76622)
+++ branches/mainsoft/gh20/mcs/class/System.Web/System.Web.Caching/ChangeLog    
2007-05-03 14:36:24 UTC (rev 76623)
@@ -1,3 +1,9 @@
+2007-05-03 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * AggregateCacheDependency.cs:
+       * CacheDependency.cs:   
+       added missing API.      
+
 2007-04-10  Marek Habersack  <[EMAIL PROTECTED]>
 
        * CacheDependency.cs: add the NotifyFilters.Size to the

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
    2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
    2007-05-03 14:36:24 UTC (rev 76623)
@@ -47,6 +47,73 @@
                        this.bag = bag;
                }
 
+               public override bool Equals (object obj) 
+               {
+                       AttributeCollection other = obj as AttributeCollection;
+                       if (other == null) {
+                               return false;
+                       }
+
+                       if (Count != other.Count) {
+                               return false;
+                       }
+
+                       foreach (string key in Keys) {
+                               if (0 == String.CompareOrdinal (key, 
StyleAttribute)) {
+                                       continue;
+                               }
+                               if (0 == String.CompareOrdinal (other [key], 
this [key])) {
+                                       return false;
+                               }
+                       }
+
+                       if ((styleCollection == null && other.styleCollection 
!= null) ||
+                               (styleCollection != null && 
other.styleCollection == null)) {
+                               return false;
+                       }
+                       else if (styleCollection != null){
+                               // other.styleCollection != null too
+                               if (styleCollection.Count != 
other.styleCollection.Count){
+                                       return false;
+                               }
+                               foreach (string styleKey in 
styleCollection.Keys){
+                                       if (0 == 
String.CompareOrdinal(styleCollection [styleKey], other.styleCollection 
[styleKey])) {
+                                               return false;
+                                       }
+                               }
+                       }
+
+                       return true;
+               }
+
+               public override int GetHashCode () 
+               {
+                       int hashValue = 0;
+                       
+                       foreach (string key in Keys) {
+                               if (key == StyleAttribute) {
+                                       continue;
+                               }
+                               hashValue ^= key.GetHashCode ();
+                               string value = this [key];
+                               if (value != null) {
+                                       hashValue ^= value.GetHashCode ();
+                               }
+                       }
+
+                       if (styleCollection != null) {
+                               foreach (string styleKey in 
styleCollection.Keys) {
+                                       hashValue ^= styleCollection 
[styleKey].GetHashCode ();
+                                       string styleValue = styleCollection 
[styleKey];
+                                       if (styleValue != null) {
+                                               hashValue ^= 
styleValue.GetHashCode ();
+                                       }
+                               }
+                       }
+
+                       return hashValue;
+               }
+
                public int Count {
                        get { return bag.Count; }
                }

Modified: branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/ChangeLog 
2007-05-03 14:29:09 UTC (rev 76622)
+++ branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/ChangeLog 
2007-05-03 14:36:24 UTC (rev 76623)
@@ -1,5 +1,16 @@
 2007-05-03 Igor Zelmanovich <[EMAIL PROTECTED]>
 
+       * AttributeCollection.cs:
+       * DataBindingHandlerAttribute.cs:
+       * HtmlTextWriter.cs:
+       * PartialCachingControl.cs:
+       * TemplateControl.cs:
+       * TemplateControl.jvm.cs:
+       * XPathBinder.cs:                                               
+       added missing API.      
+
+2007-05-03 Igor Zelmanovich <[EMAIL PROTECTED]>
+
        * CssStyleCollection.cs: optimization:
        used StringBuilder instead string to hold value.
        When added key that not exists in collection, value is recalculated by 

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs
    2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs
    2007-05-03 14:36:24 UTC (rev 76623)
@@ -49,7 +49,7 @@
 
                public DataBindingHandlerAttribute (string name)
                {
-                       this.name = name;
+                       this.name = (name != null) ? name : String.Empty;
                }
 
                public DataBindingHandlerAttribute (Type type)
@@ -59,6 +59,21 @@
 
                public static readonly DataBindingHandlerAttribute Default;
 
+               public override bool Equals (object obj) 
+               {
+                       DataBindingHandlerAttribute other = obj as 
DataBindingHandlerAttribute;
+                       if (other == null) {
+                               return false;
+                       }
+
+                       return HandlerTypeName.Equals (other.HandlerTypeName);
+               }
+
+               public override int GetHashCode () 
+               {
+                       return HandlerTypeName.GetHashCode ();
+               }
+
                public string HandlerTypeName {
                        get { return name; }
                }

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
===================================================================
--- branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs 
2007-05-03 14:29:09 UTC (rev 76622)
+++ branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs 
2007-05-03 14:36:24 UTC (rev 76623)
@@ -31,6 +31,7 @@
 using System.Collections;
 using System.Security.Permissions;
 using System.Text;
+using System.Web.UI.WebControls;
 
 namespace System.Web.UI {
        
@@ -1129,6 +1130,51 @@
                {
                        Write (HttpUtility.HtmlEncode (text));
                }
+
+               [MonoNotSupported("")]
+               public virtual void WriteEncodedUrl (string url) 
+               {
+                       // WriteUrlEncodedString (url, false);
+                       throw new NotImplementedException ();
+               }
+
+               [MonoNotSupported ("")]
+               public virtual void WriteEncodedUrlParameter (string urlText) 
+               {
+                       // WriteUrlEncodedString (urlText, true);
+                       throw new NotImplementedException ();
+               }
+
+               [MonoNotSupported ("")]
+               protected void WriteUrlEncodedString (string text, bool 
argument) 
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoNotSupported ("")]
+               public virtual void EnterStyle (Style style) 
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoNotSupported ("")]
+               public virtual void EnterStyle (Style style, HtmlTextWriterTag 
tag) 
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoNotSupported ("")]
+               public virtual void ExitStyle (Style style) 
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoNotSupported ("")]
+               public virtual void ExitStyle (Style style, HtmlTextWriterTag 
tag) 
+               {
+                       throw new NotImplementedException ();
+               }
+
 #endif
        }
 }

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/PartialCachingControl.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/PartialCachingControl.cs
  2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/PartialCachingControl.cs
  2007-05-03 14:36:24 UTC (rev 76623)
@@ -39,17 +39,18 @@
        public class PartialCachingControl : BasePartialCachingControl
        {
                Type type;
+               object [] parameters;
                Control control;
 
-               internal PartialCachingControl (Type type)
+               internal PartialCachingControl (Type type, object[] parameters)
                {
                        this.type = type;
-
+                       this.parameters = parameters;
                }
 
                internal override Control CreateControl ()
                {
-                       control = (Control) Activator.CreateInstance (type);
+                       control = (Control) Activator.CreateInstance (type, 
parameters);
                        if (control is UserControl)
                                ((UserControl) control).InitializeAsUserControl 
(Page);
 
@@ -62,3 +63,4 @@
        }
 }
 
+

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/TemplateControl.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/TemplateControl.cs    
    2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/TemplateControl.cs    
    2007-05-03 14:36:24 UTC (rev 76623)
@@ -203,17 +203,22 @@
                                throw new HttpException ("virtualPath is null");
 #endif
                        Type type = GetTypeFromControlPath (virtualPath);
+                       return LoadControl (type, null);
+               }
+
+               public Control LoadControl (Type type, object[] parameters) 
+               {
                        object [] attrs = type.GetCustomAttributes (typeof 
(PartialCachingAttribute), true);
                        if (attrs != null && attrs.Length == 1) {
                                PartialCachingAttribute attr = 
(PartialCachingAttribute) attrs [0];
-                               PartialCachingControl ctrl = new 
PartialCachingControl (type);
+                               PartialCachingControl ctrl = new 
PartialCachingControl (type, parameters);
                                ctrl.VaryByParams = attr.VaryByParams;
                                ctrl.VaryByControls = attr.VaryByControls;
                                ctrl.VaryByCustom = attr.VaryByCustom;
                                return ctrl;
                        }
 
-                       object control = Activator.CreateInstance (type);
+                       object control = Activator.CreateInstance (type, 
parameters);
                        if (control is UserControl)
                                ((UserControl) control).InitializeAsUserControl 
(Page);
 

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
    2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/TemplateControl.jvm.cs
    2007-05-03 14:36:24 UTC (rev 76623)
@@ -281,7 +281,30 @@
 
                public Control LoadControl (string virtualPath)
                {
-                       object control = Activator.CreateInstance 
(GetTypeFromControlPath (virtualPath));
+#if NET_2_0
+                       if (virtualPath == null)
+                               throw new ArgumentNullException ("virtualPath");
+#else
+                       if (virtualPath == null)
+                               throw new HttpException ("virtualPath is null");
+#endif
+                       Type type = GetTypeFromControlPath (virtualPath);
+                       return LoadControl (type, null);
+               }
+
+               public Control LoadControl (Type type, object [] parameters)
+               {
+                       object [] attrs = type.GetCustomAttributes (typeof 
(PartialCachingAttribute), true);
+                       if (attrs != null && attrs.Length == 1) {
+                               PartialCachingAttribute attr = 
(PartialCachingAttribute) attrs [0];
+                               PartialCachingControl ctrl = new 
PartialCachingControl (type, parameters);
+                               ctrl.VaryByParams = attr.VaryByParams;
+                               ctrl.VaryByControls = attr.VaryByControls;
+                               ctrl.VaryByCustom = attr.VaryByCustom;
+                               return ctrl;
+                       }
+
+                       object control = Activator.CreateInstance (type, 
parameters);
                        if (control is UserControl)
                                ((UserControl) control).InitializeAsUserControl 
(Page);
 

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/XPathBinder.cs
===================================================================
--- branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/XPathBinder.cs    
2007-05-03 14:29:09 UTC (rev 76622)
+++ branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/XPathBinder.cs    
2007-05-03 14:36:24 UTC (rev 76623)
@@ -43,16 +43,11 @@
 
                public static object Eval (object container, string xpath)
                {
-                       return Eval (container, xpath, null);
+                       return Eval (container, xpath, 
(IXmlNamespaceResolver)null);
                }
 
-               public static string Eval (object container, string xpath, 
string format)
+               public static object Eval (object container, string xpath, 
IXmlNamespaceResolver resolver) 
                {
-                       return Eval (container, xpath, format, null);
-               }
-
-               public static string Eval (object container, string xpath, 
string format, IXmlNamespaceResolver resolver)
-               {
                        if (xpath == null || xpath.Length == 0)
                                throw new ArgumentNullException ("xpath");
 
@@ -71,6 +66,18 @@
                                        return null;
                        }
 
+                       return result;
+               }
+
+               public static string Eval (object container, string xpath, 
string format)
+               {
+                       return Eval (container, xpath, format, null);
+               }
+
+               public static string Eval (object container, string xpath, 
string format, IXmlNamespaceResolver resolver)
+               {
+                       object result = Eval (container, xpath, 
(IXmlNamespaceResolver)null);
+                       
                        if (result == null)
                                return String.Empty;
                        if (format == null || format.Length == 0)

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog 
    2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog 
    2007-05-03 14:36:24 UTC (rev 76623)
@@ -1,3 +1,11 @@
+2007-05-03 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * ControlPropertyNameConverter.css:
+       * FontUnitConverter.cs:
+       * UnitConverter.cs:
+       * ValidatedControlConverter.cs:                 
+       added missing API.      
+
 2007-05-02 Igor Zelmanovich <[EMAIL PROTECTED]>
 
        * SqlDataSourceView.cs:

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ControlPropertyNameConverter.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ControlPropertyNameConverter.cs
       2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ControlPropertyNameConverter.cs
       2007-05-03 14:36:24 UTC (rev 76623)
@@ -36,6 +36,25 @@
 {
        public class ControlPropertyNameConverter: StringConverter
        {
+               [MonoLimitation("This implementation always returns null")]
+               public override StandardValuesCollection GetStandardValues 
(ITypeDescriptorContext context) 
+               {
+                       return null;
+               }
+
+               public override bool GetStandardValuesSupported 
(ITypeDescriptorContext context) 
+               {
+                       if (context != null) {
+                               return true;
+                       }
+
+                       return false;
+               }
+
+               public override bool GetStandardValuesExclusive 
(ITypeDescriptorContext context) 
+               {
+                       return false;
+               }
        }
 }
 

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs
  2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs
  2007-05-03 14:36:24 UTC (rev 76623)
@@ -49,6 +49,15 @@
                        return base.CanConvertFrom (context, sourceType);
                }
 
+               public override bool CanConvertTo (ITypeDescriptorContext 
context, Type destinationType) 
+               {
+                       if (destinationType == typeof (string)) {
+                               return true;
+                       }
+
+                       return base.CanConvertTo (context, destinationType);
+               }
+
                public override object ConvertFrom(ITypeDescriptorContext 
context, System.Globalization.CultureInfo culture, object value) 
                {
                        string  s;

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs
      2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs
      2007-05-03 14:36:24 UTC (rev 76623)
@@ -51,7 +51,16 @@
 
                        return base.CanConvertFrom (context, sourceType);
                }
-               
+
+               public override bool CanConvertTo (ITypeDescriptorContext 
context, Type destinationType) 
+               {
+                       if (destinationType == typeof (string)) {
+                               return true;
+                       }
+
+                       return base.CanConvertTo (context, destinationType);
+               }
+
                public override object ConvertTo (ITypeDescriptorContext 
context, CultureInfo culture, object value, Type destinationType)
                {
                        if (value is Unit && destinationType == typeof (string))

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs
===================================================================
--- 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs
  2007-05-03 14:29:09 UTC (rev 76622)
+++ 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs
  2007-05-03 14:36:24 UTC (rev 76623)
@@ -48,11 +48,11 @@
 
                #region Public Instance Methods
                // We need to return all controls that have a validation 
property
-               public override TypeConverter.StandardValuesCollection 
GetStandardValues(ITypeDescriptorContext context) {
+               public override TypeConverter.StandardValuesCollection 
GetStandardValues(ITypeDescriptorContext context) 
+               {
                        if ((context != null) && (context.Container != null) && 
(context.Container.Components != null)) {
                                ArrayList               values;
                                int                     count;
-                               PropertyDescriptor      pd;
                                string                  id;
                                ComponentCollection     components;             
 
@@ -61,8 +61,7 @@
                                count = components.Count;
 
                                for (int i = 0; i < count; i++) {
-                                       pd = 
BaseValidator.GetValidationProperty(components[i]);
-                                       if (pd != null) {       // We have a 
ValidationProperty
+                                       if 
(FilterControl((Control)components[i])) {    // We have a ValidationProperty
                                                id = 
((Control)components[i]).ID;
                                                if ((id != null) && (id.Length 
> 0)) {
                                                        values.Add(id);
@@ -80,6 +79,14 @@
                        return base.GetStandardValues (context);
                }
 
+#if NET_2_0
+               protected override 
+#endif
+               bool FilterControl (Control control) 
+               {
+                       return BaseValidator.GetValidationProperty (control) != 
null;
+               }
+
                public override bool 
GetStandardValuesExclusive(ITypeDescriptorContext context) {
                        return false;
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to