Пример #1
0
        private static BSonDoc DeserializeDocument(BinaryReader reader, BSonDocumentType doctype)
        {
            var doc = new BSonDoc(doctype);

            doc.Name = reader.ReadString();
            var size        = reader.ReadInt32();
            var endposition = reader.BaseStream.Position + size;

            while (reader.BaseStream.Position < endposition)
            {
                var res = NavigateStream(reader);

                var pp = res as IBSonNode;
                if (pp != null)
                {
                    doc[pp.Name] = pp.Value;
                }
            }

            return(doc);
        }
Пример #2
0
 public BSonDoc(BSonDocumentType doctype = BSonDocumentType.BSON_Document)
 {
   DocType = doctype;
 }
Пример #3
0
 public BSonDoc(BSonDocumentType doctype = BSonDocumentType.BSON_Document)
 {
     DocType = doctype;
 }