Example #1
0
 /// <summary>
 /// Removes an element from this document.
 /// </summary>
 /// <param name="element">The element to remove.</param>
 public override void RemoveElement(BsonElement element)
 {
     EnsureIsMaterialized();
     base.RemoveElement(element);
 }
Example #2
0
 /// <summary>
 /// Sets an element of the document (replacing the existing element at that position).
 /// </summary>
 /// <param name="index">The zero based index of the element to replace.</param>
 /// <param name="element">The new element.</param>
 /// <returns>
 /// The document.
 /// </returns>
 public override BsonDocument SetElement(int index, BsonElement element)
 {
     EnsureIsMaterialized();
     return(base.SetElement(index, element));
 }
Example #3
0
 // public methods
 /// <summary>
 /// Adds an element to the document.
 /// </summary>
 /// <param name="element">The element to add.</param>
 /// <returns>
 /// The document (so method calls can be chained).
 /// </returns>
 public override BsonDocument Add(BsonElement element)
 {
     EnsureIsMaterialized();
     return(base.Add(element));
 }
Example #4
0
 /// <summary>
 /// Inserts a new element at a specified position.
 /// </summary>
 /// <param name="index">The position of the new element.</param>
 /// <param name="element">The element.</param>
 public override void InsertAt(int index, BsonElement element)
 {
     EnsureIsMaterialized();
     base.InsertAt(index, element);
 }
Example #5
0
 /// <summary>
 /// Sets an element of the document (replacing the existing element at that position).
 /// </summary>
 /// <param name="index">The zero based index of the element to replace.</param>
 /// <param name="element">The new element.</param>
 /// <returns>
 /// The document.
 /// </returns>
 public override BsonDocument SetElement(int index, BsonElement element)
 {
     throw new NotSupportedException("RawBsonDocument instances are immutable.");
 }
Example #6
0
 /// <summary>
 /// Removes an element from this document.
 /// </summary>
 /// <param name="element">The element to remove.</param>
 public override void RemoveElement(BsonElement element)
 {
     throw new NotSupportedException("RawBsonDocument instances are immutable.");
 }
Example #7
0
 /// <summary>
 /// Tries to get an element of this document.
 /// </summary>
 /// <param name="name">The name of the element.</param>
 /// <param name="value">The element.</param>
 /// <returns>
 /// True if an element with that name was found.
 /// </returns>
 public override bool TryGetElement(string name, out BsonElement value)
 {
     EnsureIsMaterialized();
     return(base.TryGetElement(name, out value));
 }
 /// <summary>
 /// Initializes a new instance of the BsonDocument class and adds one element.
 /// </summary>
 /// <param name="element">An element to add to the document.</param>
 public BsonDocument(BsonElement element)
     : base(BsonType.Document)
 {
     Add(element);
 }
 /// <summary>
 /// Initializes a new instance of the BsonDocument class and adds one element.
 /// </summary>
 /// <param name="element">An element to add to the document.</param>
 public BsonDocument(BsonElement element)
 {
     Add(element);
 }