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); }
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); }