Пример #1
0
        public Resources GetResources(string filePath)
        {
            Resources resources = new Resources();

            if (File.Exists(filePath))
            {
                resources = ResourcesSerializer.DeSerialize(filePath);
                resources.createIndex();
            }
            return(resources);
        }
Пример #2
0
        public Hashtable GetLanguages(string path)
        {
            Hashtable     hashtable     = new Hashtable();
            DirectoryInfo directoryInfo = new DirectoryInfo(path);

            if (!directoryInfo.Exists)
            {
                return(hashtable);
            }
            FileInfo[] fileInfo = directoryInfo.GetFiles();
            for (int i = 0; i < fileInfo.Length; i++)
            {
                Resources resources = ResourcesSerializer.DeSerialize(fileInfo[i].FullName);
                hashtable.Add(resources.language, resources.displayName);
            }
            return(hashtable);
        }
Пример #3
0
        public void Init(string filePath)
        {
            folderPath = filePath;
            DirectoryInfo directoryInfo = new DirectoryInfo(filePath);

            languageResources.Clear();
            if (!directoryInfo.Exists)
            {
                return;
            }
            FileInfo[] fileInfo = directoryInfo.GetFiles();
            for (int i = 0; i < fileInfo.Length; i++)
            {
                Resources resources = ResourcesSerializer.DeSerialize(fileInfo[i].FullName);
                resources.createIndex();
                languageResources.Add(resources.language, resources);
            }
        }