public static NanoleafConnectionInfo ConvertFromFile(string path) { NanoleafConnectionInfo nCI = new NanoleafConnectionInfo(); if (File.Exists(path)) { string fileContent = File.ReadAllText(path); nCI = JsonConvert.DeserializeObject <NanoleafConnectionInfo>(fileContent); } return(nCI); }
public ConnectionDocument(NanoleafConnectionInfo information) { _fileContent = JsonConvert.SerializeObject(information); _path = new FileInfo().GetFilePath(); }