示例#1
0
        public static SiteSettings GetMasterSettings(bool cacheable)
        {
            if (!cacheable)
            {
                HiCache.Remove("FileCache-MasterSettings");
            }

            XmlDocument document = HiCache.Get("FileCache-MasterSettings") as XmlDocument;

            if (document == null)
            {
                string masterSettingsFilename = GetMasterSettingsFilename();

                if (!File.Exists(masterSettingsFilename))
                {
                    return(null);
                }

                document = new XmlDocument();

                document.Load(masterSettingsFilename);

                if (cacheable)
                {
                    HiCache.Max("FileCache-MasterSettings", document, new CacheDependency(masterSettingsFilename));
                }
            }

            return(SiteSettings.FromXml(document));
        }
示例#2
0
        public static SiteSettings GetMasterSettings(bool cacheable)
        {
            if (!cacheable)
            {
                HiCache.Remove("FileCache-MasterSettings");
            }
            XmlDocument xmlDocument = HiCache.Get("FileCache-MasterSettings") as XmlDocument;

            if (xmlDocument == null)
            {
                string text = SettingsManager.smethod_0();
                if (!System.IO.File.Exists(text))
                {
                    return(null);
                }
                xmlDocument = new XmlDocument();
                xmlDocument.Load(text);
                if (cacheable)
                {
                    HiCache.Max("FileCache-MasterSettings", xmlDocument, new CacheDependency(text));
                }
            }
            return(SiteSettings.FromXml(xmlDocument));
        }