1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-23 01:18:46 +00:00

🔨 Add parameter to disambiguate ToString

Caller may want base SecureString.ToString()
This commit is contained in:
Oliver Booth 2019-11-16 01:46:46 +00:00
parent aebe23f611
commit 7c42f0632f
No known key found for this signature in database
GPG Key ID: 4B0992B2602C3778

View File

@ -134,8 +134,9 @@
/// Converts a <see cref="SecureString"/> to a <see cref="String"/>. /// Converts a <see cref="SecureString"/> to a <see cref="String"/>.
/// </summary> /// </summary>
/// <param name="str">The <see cref="SecureString"/> to convert.</param> /// <param name="str">The <see cref="SecureString"/> to convert.</param>
/// <param name="extension">Whether or not to use this extension method.</param>
/// <returns>Returns a <see cref="String"/>.</returns> /// <returns>Returns a <see cref="String"/>.</returns>
public static string ToString(this SecureString str) => public static string ToString(this SecureString str, bool extension) =>
new NetworkCredential(String.Empty, str).Password; extension ? (new NetworkCredential(String.Empty, str).Password) : str.ToString();
} }
} }