Ejemplo n.º 1
0
        public bool Load(string xmlPath)
        {
            if (!File.Exists(xmlPath))
            {
                return(false);
            }

            var folder = Path.GetDirectoryName(xmlPath);

            if (string.IsNullOrEmpty(folder))
            {
                return(false);
            }

            StringCollections.Clear();
            LoadPropertiesXml(xmlPath);

            foreach (var stringFile in Directory.GetFiles(folder, @"*.xml"))
            {
                if (string.Compare(stringFile, xmlPath, true) == 0)
                {
                    continue;
                }

                var stringKey = Path.GetFileNameWithoutExtension(stringFile);
                if (string.IsNullOrEmpty(stringKey))
                {
                    continue;
                }

                var stringCollection = new StringCollection(stringKey);
                stringCollection.Load(stringFile);

                StringCollections[stringKey] = stringCollection;
            }

            _fullyLoaded = true;

            return(true);
        }