예제 #1
0
        public static object GetObject(string name)
        {
            Res res = Res.GetLoader();

            if (res == null)
            {
                return(null);
            }
            return(res.resources.GetObject(name, Res.Culture));
        }
예제 #2
0
        public static string GetString(string name, params object[] args)
        {
            Res res = Res.GetLoader();

            if (res == null)
            {
                return(null);
            }
            string @string = res.resources.GetString(name, Res.Culture);

            if (args != null && args.Length != 0)
            {
                for (int i = 0; i < args.Length; i++)
                {
                    string text = args[i] as string;
                    if (text != null && text.Length > 1024)
                    {
                        args[i] = text.Substring(0, 1021) + "...";
                    }
                }
                return(string.Format(CultureInfo.CurrentCulture, @string, args));
            }
            return(@string);
        }