示例#1
0
        /*private static class Holder
         * {
         *  private static PersonInfoModel instance = new PersonInfoModel();
         * }u*/


        public static PersonInfoModel GetInstance()
        {
            if (instance == null)
            {
                lock (_lock)
                {
                    if (instance == null)
                    {
                        instance = new PersonInfoModel();
                    }
                }
            }
            return(instance);
        }
示例#2
0
 public void init(string str)
 {
     instance = JsonConvert.DeserializeObject <PersonInfoModel>(str);
 }