public Resources GetResources(string filePath) { Resources resources = new Resources(); if (File.Exists(filePath)) { resources = ResourcesSerializer.DeSerialize(filePath); resources.createIndex(); } return(resources); }
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); }
public void Init(string filePath) { this.FolderPath = filePath; DirectoryInfo directoryInfo = new DirectoryInfo(filePath); this.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(); this.LanguageResources.Add(resources.language, resources); } }
public void Serialize(Resources resources, string filePath) { ResourcesSerializer.Serialize(filePath, resources); }