🔨 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
1 changed files with 3 additions and 2 deletions

View File

@ -134,8 +134,9 @@
/// Converts a <see cref="SecureString"/> to a <see cref="String"/>.
/// </summary>
/// <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>
public static string ToString(this SecureString str) =>
new NetworkCredential(String.Empty, str).Password;
public static string ToString(this SecureString str, bool extension) =>
extension ? (new NetworkCredential(String.Empty, str).Password) : str.ToString();
}
}