Exemplo n.º 1
0
        private IEnumerator WriteBinaryFile(string fileName, byte[] binary)
        {
            DataAlert alert     = null;
            bool      isSuccess = false;

            while (!isSuccess)
            {
                IEnumerator ie = this.persistentFile.Write(fileName, binary, delegate(bool result)
                {
                    isSuccess = result;
                });
                while (ie.MoveNext())
                {
                    object obj = ie.Current;
                    yield return(obj);
                }
                if (!isSuccess)
                {
                    if (alert == null)
                    {
                        alert = new DataAlert();
                    }
                    ie = alert.OpenAlert(this.persistentFile.GetErrorType());
                    while (ie.MoveNext())
                    {
                        object obj2 = ie.Current;
                        yield return(obj2);
                    }
                }
            }
            yield break;
        }
Exemplo n.º 2
0
        public IEnumerator WriteMasterDataVersionFile(GameWebAPI.RespDataCM_MDVersion masterDataVersion)
        {
            byte[] array = this.MasterDataToBinary(masterDataVersion);
            if (array == null)
            {
                DataAlert dataAlert = new DataAlert();
                return(dataAlert.OpenAlertJsonParseError());
            }
            string fileName = this.GetFileName("MASTER_DATA_VERSION");

            return(this.WriteBinaryFile(fileName, array));
        }
Exemplo n.º 3
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));
        }