/// <summary> /// Copy constructor /// </summary> /// <param name="sourceParameters">Source parameters</param> internal BobConnectionParametersBuilder(IModifiableBobConnectionParameters sourceParameters) { if (sourceParameters == null) { throw new ArgumentNullException(nameof(sourceParameters)); } _customParameters = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase); Host = string.Empty; IModifiableBobConnectionParametersExtensions.CopyFrom(targetParameters: this, sourceParameters: sourceParameters); }
/// <summary> /// Copy constructor /// </summary> /// <param name="sourceParameters">Source parameters</param> internal BobConnectionParameters(IModifiableBobConnectionParameters sourceParameters) { if (sourceParameters == null) { throw new ArgumentNullException(nameof(sourceParameters)); } _customParameters = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase); _nodeAddress = null; Host = string.Empty; IModifiableBobConnectionParametersExtensions.CopyFrom(targetParameters: this, sourceParameters: sourceParameters); IModifiableBobConnectionParametersExtensions.Validate(this, ValidationExceptionBehaviour.InvalidConnectionParametersException); }
/// <summary> /// Converts connection parameters to its string representation /// </summary> /// <param name="includePassword">When True password is included into string representation, otherwise it is not</param> /// <returns>String representation</returns> public string ToString(bool includePassword) { return(IModifiableBobConnectionParametersExtensions.ToString(this, includePassword)); }
/// <summary> /// Gets the value by the specified key /// </summary> /// <param name="key">Key</param> /// <param name="allowCustomParameters">If true, the CustomParameters dictionary is also used to retrieve the value</param> /// <returns>Extracted value in string representation</returns> public string GetValue(string key, bool allowCustomParameters = true) { return(IModifiableBobConnectionParametersExtensions.GetValue(this, key, allowCustomParameters)); }
/// <summary> /// Sets value for specified key /// </summary> /// <param name="key">Key</param> /// <param name="value">Value</param> /// <param name="allowCustomParameters">If false, an exception will be thrown if the parameter does not match any known. Otherwise, the value will be written into CustomParameters</param> public void SetValue(string key, string value, bool allowCustomParameters = true) { IModifiableBobConnectionParametersExtensions.SetValue(this, key, value, allowCustomParameters); }