Пример #1
0
        internal void SetReport(SmgpMessageReport report)
        {
            byte[] buffer = null;
            using (var ms = new MemoryStream())
            {
                using (var writer = new BinaryWriter(ms))
                {
                    report.NetworkWrite(writer);
                }
                buffer = ms.ToArray();
            }

            //this.Content = buffer;
            this.MessageConent = Convert.ToBase64String(buffer);
        }
Пример #2
0
        public SmgpMessageReport GetReport()
        {
            var report = new SmgpMessageReport();

            byte[] buffer = Convert.FromBase64String(this.MessageConent);
            try
            {
                using (var ms = new MemoryStream(buffer))
                {
                    using (var reader = new BinaryReader(ms))
                    {
                        report.NetworkRead(reader);
                    }
                }
            }
            catch { }
            return(report);
        }