public static string GetString(string name) { System.IO.Compression.SR loader = System.IO.Compression.SR.GetLoader(); if (loader == null) { return(null); } return(loader.resources.GetString(name, System.IO.Compression.SR.Culture)); }
private static System.IO.Compression.SR GetLoader() { if (System.IO.Compression.SR.loader == null) { System.IO.Compression.SR sR = new System.IO.Compression.SR(); Interlocked.CompareExchange <System.IO.Compression.SR>(ref System.IO.Compression.SR.loader, sR, null); } return(System.IO.Compression.SR.loader); }
public static string GetString(string name, params object[] args) { System.IO.Compression.SR loader = System.IO.Compression.SR.GetLoader(); if (loader == null) { return(null); } string str = loader.resources.GetString(name, System.IO.Compression.SR.Culture); if (args == null || args.Length == 0) { return(str); } for (int i = 0; i < (int)args.Length; i++) { string str1 = args[i] as string; if (str1 != null && str1.Length > 1024) { args[i] = string.Concat(str1.Substring(0, 1021), "..."); } } return(string.Format(CultureInfo.CurrentCulture, str, args)); }