示例#1
0
 private static StringsHelper GetLoader()
 {
     if (loader == null)
     {
         StringsHelper sr = new StringsHelper();
         Interlocked.CompareExchange(ref loader, sr, null);
     }
     return(loader);
 }
示例#2
0
        public static string GetResourceString(string res)
        {
            StringsHelper sys = GetLoader();

            if (sys == null)
            {
                return(null);
            }

            // If "res" is a resource id, temp will not be null, "res" will contain the retrieved resource string.
            // If "res" is not a resource id, temp will be null.
            string temp = sys.resources.GetString(res, StringsHelper.Culture);

            if (temp != null)
            {
                res = temp;
            }

            return(res);
        }