Example #1
0
        private static string getPrefix()
        {
            ConstantRepo cr     = ConstantRepo.getInstance();
            string       prefix = cr.opt("surfm.yoar.poker.prefix", DEFAULT_PREFIX);

            return(prefix);
        }
Example #2
0
        public URestApi accountRest()
        {
            string env = ConstantRepo.getInstance().opt <string>("env", "");

            env = string.IsNullOrEmpty(env) ? "." : "." + env + ".";
            URestApi ans = new URestApi();

            ans.host = ConstantRepo.getInstance().get <string>("account.server" + env + "host");
            ans.port = ConstantRepo.getInstance().get <string>("account.server" + env + "port");
            return(ans);
        }
Example #3
0
        internal static ActivityConfig LoadFromRepo()
        {
            ActivityConfig ans = new ActivityConfig();
            ConstantRepo   r   = ConstantRepo.getInstance();
            Type           t   = typeof(ActivityConfig);

            FieldInfo[] fis = t.GetFields();
            foreach (FieldInfo fi in fis)
            {
                ConstAttribute ca = (ConstAttribute)Attribute.GetCustomAttribute(fi, typeof(ConstAttribute));
                if (ca != null)
                {
                    object o = r.opt <object>(ca.key, null);
                    if (o != null)
                    {
                        fi.SetValue(ans, o);
                    }
                }
            }
            return(ans);
        }