public IEnumerator WriteMasterDataFile(MasterBase masterData) { byte[] array = this.MasterDataToBinary(masterData.GetData()); if (array == null) { DataAlert dataAlert = new DataAlert(); return(dataAlert.OpenAlertJsonParseError()); } string fileName = this.GetFileName(masterData.ID.ToString()); return(this.WriteBinaryFile(fileName, array)); }
public IEnumerator ReadMasterDataFile(MasterBase masterData) { string fileName = this.GetFileName(masterData.ID.ToString()); return(this.persistentFile.Read(fileName, delegate(bool result, byte[] binary) { if (result) { try { masterData.BinaryToData(binary); } catch { } } })); }