示例#1
0
        public void Read(BinaryReader reader)
        {
            var adaptor = new BinaryReadAdaptor(reader);

            _domain   = adaptor.ReadStringNullable();
            _expires  = adaptor.ReadDateTime().ToSystemDateTime();
            _httpOnly = adaptor.ReadBoolean();
            _name     = adaptor.ReadStringNullable();
            _path     = adaptor.ReadStringNullable();
            _secure   = adaptor.ReadBoolean();
            _value    = adaptor.ReadStringNullable();
        }
示例#2
0
        private void Read(BinaryReadAdaptor adaptor, List <InstrumentationEntry> entries)
        {
            int count = adaptor.ReadInt32();

            for (int index = 0; index < count; ++index)
            {
                string key   = null;
                object value = null;

                // Key.

                if (!adaptor.ReadBoolean())
                {
                    key = adaptor.ReadString();
                }

                // Value.

                if (!adaptor.ReadBoolean())
                {
                    if (adaptor.ReadBoolean())
                    {
                        // Details.

                        InstrumentationDetails details = new InstrumentationDetails();
                        Read(adaptor, details.m_entries);
                        value = details;
                    }
                    else
                    {
                        value = adaptor.ReadObject();
                    }
                }

                entries.Add(new InstrumentationEntry(key, value));
            }
        }
示例#3
0
        private void ReadStandard(BinaryReader reader)
        {
            var adaptor = new BinaryReadAdaptor(reader);

            _event    = adaptor.ReadString();
            _source   = adaptor.ReadString();
            _type     = adaptor.ReadString();
            _method   = adaptor.ReadString();
            _message  = adaptor.ReadString();
            _time     = new System.DateTime(adaptor.ReadInt64());
            _sequence = adaptor.ReadInt32();

            if (adaptor.ReadBoolean())
            {
                _exception = ExceptionInfo.FromBinary(reader);
            }
        }
示例#4
0
        protected override void ReadContents(BinaryReader reader)
        {
            // Pass to base first.

            base.ReadContents(reader);

            // Read all properties.

            BinaryReadAdaptor adaptor = new BinaryReadAdaptor(reader);

            foreach (PropertyInfo propertyInfo in PropertyInfos)
            {
                bool isNull = adaptor.ReadBoolean();
                if (isNull)
                {
                    m_properties[propertyInfo.Name] = null;
                }
                else
                {
                    m_properties[propertyInfo.Name] = adaptor.ReadType(propertyInfo.Type);
                }
            }
        }