Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
 /// <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));
 }
Beispiel #4
0
 /// <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));
 }
Beispiel #5
0
 /// <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);
 }