Exemplo n.º 1
0
        /// <summary>
        /// Determines if a browser is uplevel.
        /// </summary>
        /// <param name="context">HttpContext containing browser information.</param>
        /// <returns>true if uplevel, false if downlevel.</returns>
        public bool IsUpLevelBrowser(HttpContext context)
        {
            if ((context == null) || (context.Request == null))
            {
                return false;
            }

            HttpBrowserCapabilities browser = context.Request.Browser;
            if (browser == null)
            {
                return false;
            }

            BrowserLevel minLevel = new BrowserLevel(browser.MajorVersion, browser.MinorVersion, browser.Win32);

            Object obj = _Browsers[browser.Browser.ToLower()];
            if (obj == null)
            {
                return false;
            }

            BrowserLevel bl = (BrowserLevel)obj;
            return (minLevel >= bl);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Adds an uplevel browser.
 /// </summary>
 /// <param name="browser">Uplevel browser name.</param>
 /// <param name="majorversion">Uplevel major version.</param>
 /// <param name="minorversion">Uplevel minor version.</param>
 /// <param name="requireWindows">Uplevel Win32 required.</param>
 public void Add(string browser, int majorversion, double minorversion, bool requireWindows)
 {
     BrowserLevel bl = new BrowserLevel(majorversion, minorversion, requireWindows);
     Add(browser, bl);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Adds an uplevel browser.
 /// </summary>
 /// <param name="browser">Uplevel browser name.</param>
 /// <param name="minBrowser">Uplevel browser version.</param>
 public void Add(string browser, BrowserLevel minBrowser)
 {
     _Browsers.Add(browser.ToLower(), minBrowser);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of a BrowserLevelChecker.
 /// </summary>
 /// <param name="browser">Uplevel browser name.</param>
 /// <param name="minBrowser">Uplevel browser version.</param>
 public BrowserLevelChecker(string browser, BrowserLevel minBrowser) : this()
 {
     Add(browser, minBrowser);
 }