DatabaseResourceManager.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:1k
- using System;
- using System.Resources;
- using System.Globalization;
- using System.Collections;
- namespace Wrox.ProCSharp.Localization
- {
- public class DatabaseResourceManager : ResourceManager
- {
- private string dsn;
- public DatabaseResourceManager(string dsn)
- {
- this.dsn = dsn;
- ResourceSets = new Hashtable();
- }
- protected override ResourceSet InternalGetResourceSet(
- CultureInfo culture, bool createIfNotExists, bool tryParents)
- {
- DatabaseResourceSet rs = null;
- if (ResourceSets.Contains(culture.Name))
- {
- rs = ResourceSets[culture.Name] as DatabaseResourceSet;
- }
- else
- {
- rs = new DatabaseResourceSet(dsn, culture);
- ResourceSets.Add(culture.Name, rs);
- }
- return rs;
- }
- }
- }