public static MinerConfig GetInstance() { if (instance == null) { instance = ReadFromFile(); } return(instance); }
public static MinerConfig ReadFromFile(string fileFullName) { using (StreamReader sr = new StreamReader(fileFullName)) { string jsonString = sr.ReadToEnd(); MinerConfig config = JsonConvert.DeserializeObject <MinerConfig>(jsonString); return(config); } }