public static string GetString(string name, params object[] args) { EdmRes sys = GetLoader(); if (sys == null) { return(null); } string res = sys.resources.GetString(name, EdmRes.Culture); if (args != null && args.Length > 0) { for (int i = 0; i < args.Length; i++) { String value = args[i] as String; if (value != null && value.Length > 1024) { args[i] = value.Substring(0, 1024 - 3) + "..."; } } return(String.Format(CultureInfo.CurrentCulture, res, args)); } else { return(res); } }
private static EdmRes GetLoader() { if (loader == null) { EdmRes sr = new EdmRes(); Interlocked.CompareExchange(ref loader, sr, null); } return(loader); }
public static string GetString(string name) { EdmRes sys = GetLoader(); if (sys == null) { return(null); } return(sys.resources.GetString(name, EdmRes.Culture)); }