Beispiel #1
0
        public Resources GetResources(string filePath)
        {
            var resources = new Resources();

            if (File.Exists(filePath))
            {
                resources = ResourcesSerializer.DeSerialize(filePath);
                resources.CreateIndex();
            }
            return(resources);
        }
Beispiel #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);
        }
Beispiel #3
0
        public Hashtable GetLanguages(string path)
        {
            var hashtable     = new Hashtable();
            var directoryInfo = new DirectoryInfo(path);

            if (!directoryInfo.Exists)
            {
                return(hashtable);
            }
            var fileInfo = directoryInfo.GetFiles();

            for (var i = 0; i < fileInfo.Length; i++)
            {
                var resources = ResourcesSerializer.DeSerialize(fileInfo[i].FullName);
                hashtable.Add(resources.Language, resources.DisplayName);
            }
            return(hashtable);
        }
Beispiel #4
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);
            }
        }
Beispiel #5
0
        public void Init(string filePath)
        {
            _folderPath = filePath;
            var directoryInfo = new DirectoryInfo(filePath);

            LanguageResources.Clear();
            if (!directoryInfo.Exists)
            {
                return;
            }
            var fileInfo = directoryInfo.GetFiles();

            for (var i = 0; i < fileInfo.Length; i++)
            {
                var resources = ResourcesSerializer.DeSerialize(fileInfo[i].FullName);
                resources.CreateIndex();
                LanguageResources.Add(resources.Language, resources);
            }
        }
Beispiel #6
0
 public void Serialize(Resources resources, string filePath)
 {
     ResourcesSerializer.Serialize(filePath, resources);
 }