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:
parent
aebe23f611
commit
7c42f0632f
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user