示例#1
0
        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));
        }
示例#2
0
        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
                    {
                    }
                }
            }));
        }