FrozenCopy() public method

Returns a frozen copy of the settings.
public FrozenCopy ( ) : MongoServerSettings
return MongoServerSettings
        // constructors
        /// <summary>
        /// Creates a new instance of MongoServer. Normally you will use one of the Create methods instead
        /// of the constructor to create instances of this class.
        /// </summary>
        /// <param name="settings">The settings for this instance of MongoServer.</param>
        public MongoServer(MongoServerSettings settings)
        {
            _settings     = settings.FrozenCopy();
            _sequentialId = Interlocked.Increment(ref __nextSequentialId);
            // Console.WriteLine("MongoServer[{0}]: {1}", sequentialId, settings);

            _serverProxy = new MongoServerProxyFactory().Create(_settings);
        }
        // constructors
        /// <summary>
        /// Creates a new instance of MongoServer. Normally you will use one of the Create methods instead
        /// of the constructor to create instances of this class.
        /// </summary>
        /// <param name="settings">The settings for this instance of MongoServer.</param>
        public MongoServer(MongoServerSettings settings)
        {
            _settings     = settings.FrozenCopy();
            _sequentialId = Interlocked.Increment(ref __nextSequentialId);
            // Console.WriteLine("MongoServer[{0}]: {1}", sequentialId, settings);

            _cluster = ClusterRegistry.Instance.GetOrCreateCluster(_settings.ToClusterKey());
            StartTrackingServerInstances();
        }
 public void TestFrozenCopy()
 {
     var settings = new MongoServerSettings();
     var frozenCopy = settings.FrozenCopy();
     var secondFrozenCopy = frozenCopy.FrozenCopy();
     Assert.AreNotSame(settings, frozenCopy);
     Assert.AreSame(frozenCopy, secondFrozenCopy);
     Assert.AreEqual(false, settings.IsFrozen);
     Assert.AreEqual(true, frozenCopy.IsFrozen);
 }