Ejemplo n.º 1
0
        public static BrowserAccessRule FromCurrentContext()
        {
            if(HttpContext.Current == null)
                return null;

            HttpBrowserCapabilities browser = HttpContext.Current.Request.Browser;
            BrowserAccessRule retVal = new BrowserAccessRule();
            retVal.Browser = browser.Browser;
            retVal.MinimumMajorVersion = browser.MajorVersion;
            retVal.MinimumMinorVersion = browser.MinorVersion;

            return retVal;
        }
Ejemplo n.º 2
0
        public static BrowserAccessRule FromCurrentContext()
        {
            if (HttpContext.Current == null)
            {
                return(null);
            }

            HttpBrowserCapabilities browser = HttpContext.Current.Request.Browser;
            BrowserAccessRule       retVal  = new BrowserAccessRule();

            retVal.Browser             = browser.Browser;
            retVal.MinimumMajorVersion = browser.MajorVersion;
            retVal.MinimumMinorVersion = browser.MinorVersion;

            return(retVal);
        }
Ejemplo n.º 3
0
        public static void Initialize()
        {
            // instantiate here so the ApprovedBrowserXmlPath can be determined from the config file.
            browserAccessInfo = new BrowserAccessInfo();
            string localPath = HttpContext.Current.Server.MapPath(ApprovedBrowserXmlPath);

            if (!File.Exists(localPath))
            {
                BrowserAccessInfo temp = new BrowserAccessInfo();
                temp.AddRule(BrowserAccessRule.FromCurrentContext());
                SerializationUtil.XmlSerialize(temp, localPath);
            }

            // assign the deserialized version to the current instance;
            browserAccessInfo = SerializationUtil.DeserializeFromFile <BrowserAccessInfo>(localPath);
        }
Ejemplo n.º 4
0
 public void AddRule(BrowserAccessRule rule)
 {
     this.approvedBrowers.Add(rule);
 }
Ejemplo n.º 5
0
 public void AddRule(BrowserAccessRule rule)
 {
     this.approvedBrowers.Add(rule);
 }