2007-01-30 Igor Zelmanovich <igorz@mainsoft.com>
[mono.git] / mcs / class / System.Web / System.Web / BrowserCapabilities.cs
index 1e219c54be9e35b2d13337ccb17be91a78a0ba4d..edf2cc96434aa58d07ec8e96093926c370dc260d 100644 (file)
@@ -33,6 +33,7 @@ using System.Collections;
 using System.Globalization;
 using System.Web.Configuration;
 using System.Web.UI;
+using System.Security.Permissions;
 
 #if NET_2_0
 namespace System.Web.Configuration {
@@ -40,7 +41,9 @@ namespace System.Web.Configuration {
 #else
 
 namespace System.Web {
-       public partial class HttpBrowserCapabilities : HttpCapabilitiesBase
+       [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+       [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+       public class HttpBrowserCapabilities : HttpCapabilitiesBase
 #endif
        {
                const int HaveActiveXControls = 1;
@@ -58,7 +61,7 @@ namespace System.Web {
                const int HaveJavaScript = 13;
                const int HaveMajorVersion = 14;
                const int HaveMinorVersion = 15;
-               //const int HaveMSDomVersion = 16;
+               const int HaveMSDomVersion = 16;
                const int HavePlatform = 17;
                const int HaveTables = 18;
                //const int HaveTagWriter = 19;
@@ -84,7 +87,7 @@ namespace System.Web {
                bool javaScript;
                int majorVersion;
                double minorVersion;
-               //Version msDomVersion;
+               Version msDomVersion;
                string platform;
                bool tables;
                //Type tagWriter;
@@ -96,6 +99,12 @@ namespace System.Web {
                Version [] clrVersions;
                internal string useragent;
 
+#if !NET_2_0
+               public HttpBrowserCapabilities ()
+               {
+               }
+#endif
+
                public bool ActiveXControls {
                        get {
                                if (!Get (HaveActiveXControls)) {
@@ -153,7 +162,7 @@ namespace System.Web {
                        }
                }
 #if NET_2_0
-               [MonoTODO]
+               [MonoTODO ("Not implemented")]
                public ArrayList Browsers {
                        get { throw new NotImplementedException (); }
                }
@@ -273,7 +282,17 @@ namespace System.Web {
 
                public Version MSDomVersion {
                        get {
-                               return new Version (0, 0);
+                               if (!Get (HaveMSDomVersion)) {
+                                       string ver_str;
+                                       Set (HaveMSDomVersion);
+                                       ver_str = this ["msdomversion"];
+                                       if (ver_str == null)
+                                               msDomVersion = new Version (0, 0);
+                                       else
+                                               msDomVersion = new Version (ver_str);
+                               }
+
+                               return msDomVersion;
                        }
                }