Table of Contents

Class BsonWriterSettings

Namespace
MongoDB.Bson.IO
Assembly
MongoDB.Bson.dll

Represents settings for a BsonWriter.

[Serializable]
public abstract class BsonWriterSettings
Inheritance
BsonWriterSettings
Derived
Inherited Members
Extension Methods

Constructors

BsonWriterSettings()

Initializes a new instance of the BsonWriterSettings class.

protected BsonWriterSettings()

BsonWriterSettings(GuidRepresentation)

Initializes a new instance of the BsonWriterSettings class.

[Obsolete("Configure serializers instead.")]
protected BsonWriterSettings(GuidRepresentation guidRepresentation)

Parameters

guidRepresentation GuidRepresentation

The representation for Guids.

Properties

GuidRepresentation

Gets or sets the representation for Guids.

[Obsolete("Configure serializers instead.")]
public GuidRepresentation GuidRepresentation { get; set; }

Property Value

GuidRepresentation

IsFrozen

Gets whether the settings are frozen.

public bool IsFrozen { get; }

Property Value

bool

MaxSerializationDepth

Gets or sets the max serialization depth allowed (used to detect circular references).

public int MaxSerializationDepth { get; set; }

Property Value

int

Methods

Clone()

Creates a clone of the settings.

public BsonWriterSettings Clone()

Returns

BsonWriterSettings

A clone of the settings.

CloneImplementation()

Creates a clone of the settings.

protected abstract BsonWriterSettings CloneImplementation()

Returns

BsonWriterSettings

A clone of the settings.

Freeze()

Freezes the settings.

public BsonWriterSettings Freeze()

Returns

BsonWriterSettings

The frozen settings.

FrozenCopy()

Returns a frozen copy of the settings.

public BsonWriterSettings FrozenCopy()

Returns

BsonWriterSettings

A frozen copy of the settings.

ThrowFrozenException()

Throws an InvalidOperationException when an attempt is made to change a setting after the settings are frozen.

protected void ThrowFrozenException()