예제 #1
0
        public override void Serialize(SyncBatchInfo batchInfo)
        {
            DmBinaryConverter <SyncBatchInfo> converter = new DmBinaryConverter <SyncBatchInfo>();

            using (FileStream fileStream = new FileStream(batchFileName, FileMode.Create, FileAccess.ReadWrite))
            {
                try
                {
                    converter.Serialize(batchInfo, fileStream);
                }
                catch
                {
                }
            }
        }
예제 #2
0
        public override SyncBatchInfo Deserialize(bool deserializeData = true)
        {
            DmBinaryConverter <SyncBatchInfo> converter = new DmBinaryConverter <SyncBatchInfo>();

            SyncBatchInfo dbSyncBatchInfo = null;

            using (FileStream fileStream = new FileStream(batchFileName, FileMode.Open, FileAccess.ReadWrite))
            {
                try
                {
                    dbSyncBatchInfo = converter.Deserialize(fileStream);

                    //if (deserializeData)
                    //    dbSyncBatchInfo.DmSet = converter.Deserialize<DmSet>(dbSyncBatchInfo.DmSet);
                }
                catch
                {
                }
            }
            return(dbSyncBatchInfo);
        }