From 7c42f0632f1f89b4d559d5dbcc3714109bcb6fc5 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sat, 16 Nov 2019 01:46:46 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Add=20parameter=20to=20disambigu?= =?UTF-8?q?ate=20ToString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Caller may want base SecureString.ToString() --- X10D/StringExtensions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/X10D/StringExtensions.cs b/X10D/StringExtensions.cs index 512c007..f795f4e 100644 --- a/X10D/StringExtensions.cs +++ b/X10D/StringExtensions.cs @@ -134,8 +134,9 @@ /// Converts a to a . /// /// The to convert. + /// Whether or not to use this extension method. /// Returns a . - 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(); } }