示例#1
0
 private static SRHelper GetLoader()
 {
     if (loader == null)
     {
         SRHelper sr = new SRHelper();
         Interlocked.CompareExchange(ref loader, sr, null);
     }
     return(loader);
 }
示例#2
0
        public static string GetResourceString(string res)
        {
            SRHelper 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, SRHelper.Culture);

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

            return(res);
        }