示例#1
0
 /// <summary>
 /// Initializes a new instance of the BsonWriter class.
 /// </summary>
 protected BsonWriter(
     BsonWriterSettings settings
     )
 {
     this.settings = settings.Freeze();
     this.state    = BsonWriterState.Initial;
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the BsonWriter class.
 /// </summary>
 /// <param name="settings">The writer settings.</param>
 protected BsonWriter(
     BsonWriterSettings settings
 )
 {
     this.settings = settings.FrozenCopy();
     this.state = BsonWriterState.Initial;
 }
示例#3
0
        /// <inheritdoc />
        public void PushSettings(Action <BsonWriterSettings> configurator)
        {
            var newSettings = _settings.Clone();

            configurator(newSettings);
            newSettings.Freeze();
            _settingsStack.Push(_settings);
            _settings = newSettings;
        }
        // constructors
        /// <summary>
        /// Initializes a new instance of the BsonWriter class.
        /// </summary>
        /// <param name="settings">The writer settings.</param>
        protected BsonWriter(BsonWriterSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            _settings = settings.FrozenCopy();
            _state = BsonWriterState.Initial;
        }
示例#5
0
        // constructors
        /// <summary>
        /// Initializes a new instance of the BsonWriter class.
        /// </summary>
        /// <param name="settings">The writer settings.</param>
        protected BsonWriter(BsonWriterSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            _settings = settings.FrozenCopy();
            _state    = BsonWriterState.Initial;
        }
示例#6
0
 // constructors
 /// <summary>
 /// Initializes a new instance of the BsonWriter class.
 /// </summary>
 /// <param name="settings">The writer settings.</param>
 protected BsonWriter(BsonWriterSettings settings)
 {
     _settings = settings.FrozenCopy();
     _state    = BsonWriterState.Initial;
 }
示例#7
0
 /// <inheritdoc />
 public void PopSettings()
 {
     _settings = _settingsStack.Pop();
 }