Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Resources;
- namespace TestCultureResources {
- public static class SR {
- static ResourceManager s_rm = new ResourceManager("TestCultureResources.UI.Site",typeof(SR).Assembly);
- public static string GetString(string name,params object[] args) {
- return GetString(name,null,args);
- }
- public static string GetString(string name,string defaultValue,params object[] args) {
- if(args == null || args.Length == 0) {
- return s_rm.GetString(name) ?? defaultValue;
- }
- else {
- string fmt = s_rm.GetString(name) ?? defaultValue;
- return string.Format(fmt,args);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment