コード例 #1
0
        public static MinerConfig GetInstance()
        {
            if (instance == null)
            {
                instance = ReadFromFile();
            }

            return(instance);
        }
コード例 #2
0
 public static MinerConfig ReadFromFile(string fileFullName)
 {
     using (StreamReader sr = new StreamReader(fileFullName))
     {
         string      jsonString = sr.ReadToEnd();
         MinerConfig config     = JsonConvert.DeserializeObject <MinerConfig>(jsonString);
         return(config);
     }
 }