// Loads the given JSON data into a LocalData object private void LoadData(string jsonData) { JObject obj = JObject.Parse(jsonData); LocalData deserialized = obj.ToObject <LocalData>(); installed = deserialized.installed; savedAddress = deserialized.savedAddress; }
// Loads the given JSON data into a LocalData object private static LocalData LoadData(string jsonData) { JObject obj = JObject.Parse(jsonData); LocalData deserialized = obj.ToObject <LocalData>(); deserialized.dataURL = Config.DATA_URL; deserialized.version = Config.VERSION; return(deserialized); }
public async Task Setup(Linker _linker, IProgress <ProgressReport> progress) { linker = _linker; logger.Info("Loading Local Data..."); progress.Report(new ProgressReport("Loading Local Data...")); // Create or Load LocalData data = new LocalData(); if (data.Exists()) { data = await LocalData.LoadAsync(); } else { data.SetupDefault(); } // TODO: Save user data such as pool, address, and which miners were enabled previously }