Beispiel #1
0
        public Settings(string fileName, bool isCached)
        {
            // Each skin may have its own SkinSettings.xml file so we need to use the entire path to detect a cache hit.
            // Adding a check when plugin send only the filename for mediaportal.xml instead of the full path and filename.
            _xmlFileName = fileName.ToLowerInvariant() == "mediaportal.xml"
        ? Config.GetFile(Config.Dir.Config, "MediaPortal.xml").ToLowerInvariant()
        : Path.GetFullPath(fileName).ToLowerInvariant();

            _isCached = isCached;

            if (_isCached)
            {
                XMLCache.TryGetValue(_xmlFileName, out _xmlDoc);
            }

            if (_xmlDoc == null)
            {
                _xmlDoc = new CacheSettingsProvider(new XmlSettingsProvider(fileName));

                if (_isCached)
                {
                    XMLCache.Add(_xmlFileName, _xmlDoc);
                }
            }
        }
        public Settings(string fileName, bool isCached)
        {
            xmlFileName = Path.GetFileName(fileName).ToLowerInvariant();

            _isCached = isCached;

            if (_isCached)
            {
                xmlCache.TryGetValue(xmlFileName, out xmlDoc);
            }

            if (xmlDoc == null)
            {
                xmlDoc = new CacheSettingsProvider(new XmlSettingsProvider(fileName));

                if (_isCached)
                {
                    xmlCache.Add(xmlFileName, xmlDoc);
                }
            }
        }
Beispiel #3
0
        public Settings(string fileName, bool isCached)
        {
            // Each skin may have its own SkinSettings.xml file so we need to use the entire path to detect a cache hit.
            _xmlFileName = Path.GetFullPath(fileName).ToLowerInvariant();

            _isCached = isCached;

            if (_isCached)
            {
                XMLCache.TryGetValue(_xmlFileName, out _xmlDoc);
            }

            if (_xmlDoc == null)
            {
                _xmlDoc = new CacheSettingsProvider(new XmlSettingsProvider(fileName));

                if (_isCached)
                {
                    XMLCache.Add(_xmlFileName, _xmlDoc);
                }
            }
        }