/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { // Add each argument var values = this.arguments .Select(argument => argument.ToString(dataMode)) .Where(arg => arg.Length > 0); var stringValue = string.Join(" ", values); return stringValue; }
/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { // Add each argument var values = this.arguments .Select(argument => argument.ToString(dataMode)) .Where(arg => arg.Length > 0); var stringValue = string.Join(" ", values); return(stringValue); }
/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { switch (dataMode) { case SecureDataMode.Private: return this.PrivateValue; default: return this.PublicValue; } }
/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { switch (dataMode) { case SecureDataMode.Private: return(this.PrivateValue); default: return(this.PublicValue); } }
/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { var privateValue = this.value as IPrivateData; var actualValue = privateValue == null ? (this.value ?? string.Empty).ToString() : privateValue.ToString(dataMode); if (this.doubleQuote) { actualValue = StringUtil.AutoDoubleQuoteString(actualValue); } return((this.prefix ?? null) + actualValue); }
/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { var privateValue = this.value as ISecureData; var actualValue = privateValue == null ? (this.value ?? string.Empty).ToString() : privateValue.ToString(dataMode); if (this.doubleQuote) { actualValue = (actualValue.StartsWith("\"") ? string.Empty : "\"") + actualValue + (actualValue.EndsWith("\"") ? string.Empty : "\""); } return(this.prefix + actualValue); }
/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { var builder = new StringBuilder(); // Add each argument foreach (var argument in this.arguments) { var arg = argument.ToString(dataMode); if (arg.Length > 0) { builder.Append(arg + " "); } } // Remove the trailing space if (builder.Length > 0) { builder.Remove(builder.Length - 1, 1); } return builder.ToString(); }
/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { var builder = new StringBuilder(); // Add each argument foreach (var argument in this.arguments) { var arg = argument.ToString(dataMode); if (arg.Length > 0) { builder.Append(arg + " "); } } // Remove the trailing space if (builder.Length > 0) { builder.Remove(builder.Length - 1, 1); } return(builder.ToString()); }
/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { var privateValue = this.value as IPrivateData; var actualValue = privateValue == null ? (this.value ?? string.Empty).ToString() : privateValue.ToString(dataMode); if (this.doubleQuote) { actualValue = StringUtil.AutoDoubleQuoteString(actualValue); } return (this.prefix ?? null) + actualValue; }
/// <summary> /// Returns a <see cref="System.String"/> that represents this instance in the specified data mode. /// </summary> /// <param name="dataMode">The data mode to use.</param> /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> public string ToString(SecureDataMode dataMode) { var privateValue = this.value as ISecureData; var actualValue = privateValue == null ? (this.value ?? string.Empty).ToString() : privateValue.ToString(dataMode); if (this.doubleQuote) { actualValue = (actualValue.StartsWith("\"") ? string.Empty : "\"") + actualValue + (actualValue.EndsWith("\"") ? string.Empty : "\""); } return this.prefix + actualValue; }