MongoDataSource.MongoConnectionManager.UpdateConnectionString C# (CSharp) Method

UpdateConnectionString() private method

private UpdateConnectionString ( ) : void
return void
        private void UpdateConnectionString()
        {
            string temporaryString = CONNECTIONSTRING_TEMPLATE;

            if (!string.IsNullOrWhiteSpace(_serverName))
                temporaryString = temporaryString.Replace("<servername>", _serverName);

            if (!string.IsNullOrWhiteSpace(_userName))
                temporaryString = temporaryString.Replace("<username>", _userName);

            if (!string.IsNullOrWhiteSpace(_password))
                temporaryString = temporaryString.Replace("<password>", _password);

            if (SlaveOk || Ssl)
            {
                temporaryString += "/?";

                if (SlaveOk)
                {
                    temporaryString += "connect=direct;slaveok=true";

                    if(Ssl)
                        temporaryString += ";";
                }

                if (Ssl)
                    temporaryString += "ssl=true;sslverifycertificate=false";
            }

            _connectionString = temporaryString;
        }