2008-10-01 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Wed, 1 Oct 2008 09:01:53 +0000 (09:01 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 1 Oct 2008 09:01:53 +0000 (09:01 -0000)
* CapabilitiesResult.cs: added support for the "browsers"
capability - a collection of matching browser ids.

* nBrowser/Node.cs: store matching browser ids in the capabilities
collection (to support IsBrowser correctly)

2008-10-01  Marek Habersack  <mhabersack@novell.com>

* BrowserCapabilities.cs: IsBrowser needs to compare browser names
case insensitively.

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

mcs/class/System.Web/System.Web.Configuration_2.0/CapabilitiesResult.cs
mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Node.cs
mcs/class/System.Web/System.Web/BrowserCapabilities.cs
mcs/class/System.Web/System.Web/ChangeLog

index 57d2ff0b23cba3aea7deaa6b81bee674716e9dba..ff55dbb6cf1e116297e00d0403f7e2e0e75f72d4 100644 (file)
@@ -24,6 +24,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 namespace System.Web.Configuration
 {
        using System;
+       using System.Collections;
        using System.Collections.Generic;
        using System.Text;
        using System.Reflection;
@@ -43,6 +44,7 @@ namespace System.Web.Configuration
                        : base()
                {
                        base.Capabilities = items;
+                       Capabilities ["browsers"] = new ArrayList ();
                }
 
                static CapabilitiesResult () {
@@ -67,6 +69,14 @@ namespace System.Web.Configuration
                {
                        this.Capabilities[name] = value;
                }
+
+               internal void AddMatchingBrowserId (string id)
+               {
+                       ArrayList al = Capabilities ["browsers"] as ArrayList;
+                       if (al != null && !al.Contains (id))
+                               al.Add (id);
+               }
+               
                internal virtual string Replace(string item)
                {
                        if (item.IndexOf("$") > -1)
index 1611be7847922b871f23bbfbbf6898e8bc81dad9..0b2e9ba3276cc625c8efbb15fac93e898ff2b8f2 100644 (file)
@@ -1,3 +1,11 @@
+2008-10-01  Marek Habersack  <mhabersack@novell.com>
+
+       * CapabilitiesResult.cs: added support for the "browsers"
+       capability - a collection of matching browser ids.
+
+       * nBrowser/Node.cs: store matching browser ids in the capabilities
+       collection (to support IsBrowser correctly)
+
 2008-07-25  Dean Brettle <dean@brettle.com>
 
        * nBrowser/Node.cs nBrowser/Build.cs nBrowser/Identification.cs: Fixed race
index f7e133ed8e251af1d5b38aeb85b25bfa2fa9cb46..a3cb786c1382e7bdf961472f83b6ce70bdb05767 100644 (file)
@@ -577,6 +577,7 @@ namespace System.Web.Configuration.nBrowser
                                        return false;
                        }
 
+                       result.AddMatchingBrowserId (this.Id);
                        #region Browser Identification Successfull
                        //----------------------------------------------------------------------
                        //By reaching this point, it either means there were no Identification 
index 4b0811ce94356fb00a9128ab980520a585401b95..38ca579f676eff98045b7ff4d5f319fb502552e5 100644 (file)
@@ -266,10 +266,10 @@ namespace System.Web {
                public bool IsBrowser (string browserName) 
                {
                        foreach (string browser in Browsers) {
-                               if (0 == String.CompareOrdinal(browser, "Unknown")) {
+                               if (0 == String.Compare (browser, "Unknown", StringComparison.OrdinalIgnoreCase)) {
                                        continue;
                                }
-                               if (0 == String.CompareOrdinal(browserName, browser)) {
+                               if (0 == String.Compare (browserName, browser, StringComparison.OrdinalIgnoreCase)) {
                                        return true;
                                }
                        }
index 7c2eae2527c63fc7f474d17a7d7a184b83144f01..d25e7edd6e2adadad9e8b32aa184ae932e7f4e1b 100644 (file)
@@ -1,3 +1,8 @@
+2008-10-01  Marek Habersack  <mhabersack@novell.com>
+
+       * BrowserCapabilities.cs: IsBrowser needs to compare browser names
+       case insensitively.
+
 2008-09-29  Marek Habersack  <mhabersack@novell.com>
 
        * HttpApplication.cs: do not assume the passed IAsyncResult is a