From db642f5c8dc7a2ec790acbca0cba1acbe843ea0d Mon Sep 17 00:00:00 2001 From: Ryan Crosby Date: Tue, 25 Aug 2020 11:23:05 +1000 Subject: [PATCH 1/3] Fix XML documentation --- FormatWith/Internal/FormatHelpers.cs | 22 ++++++++++++---------- FormatWith/Internal/FormatWithMethods.cs | 2 +- FormatWith/ReplacementResult.cs | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/FormatWith/Internal/FormatHelpers.cs b/FormatWith/Internal/FormatHelpers.cs index 0851ca3..ed55fb6 100644 --- a/FormatWith/Internal/FormatHelpers.cs +++ b/FormatWith/Internal/FormatHelpers.cs @@ -11,15 +11,16 @@ namespace FormatWith.Internal /// internal static class FormatHelpers { - /// - /// Processes a list of format tokens into a string - /// - /// List of tokens to turn into a string - /// An with keys and values to inject into the formatted result - /// The behaviour to use when the format string contains a parameter that is not present in the lookup dictionary - /// When the is specified, this string is used as a fallback replacement value when the parameter is present in the lookup dictionary. - /// The processed result of joining the tokens with the replacement dictionary. - public static string ProcessTokens( + /// + /// Processes a list of format tokens into a string + /// + /// List of tokens to turn into a string + /// The function used to perform the replacements on the format tokens + /// The behaviour to use when the format string contains a parameter that is not present in the lookup dictionary + /// When the is specified, this string is used as a fallback replacement value when the parameter is present in the lookup dictionary. + /// Provides a hint to the underlying string builder to help reduce buffer reallocations. + /// The processed result of joining the tokens with the replacement dictionary. + public static string ProcessTokens( IEnumerable tokens, Func handler, MissingKeyBehaviour missingKeyBehaviour, @@ -97,9 +98,10 @@ public static string ProcessTokens( /// Processes a list of format tokens into a string /// /// List of tokens to turn into a string - /// An with keys and values to inject into the formatted result + /// The function used to perform the replacements on the format tokens /// The behaviour to use when the format string contains a parameter that is not present in the lookup dictionary /// When the is specified, this string is used as a fallback replacement value when the parameter is present in the lookup dictionary. + /// /// The processed result of joining the tokens with the replacement dictionary. public static FormattableString ProcessTokensIntoFormattableString( IEnumerable tokens, diff --git a/FormatWith/Internal/FormatWithMethods.cs b/FormatWith/Internal/FormatWithMethods.cs index 8c092c9..24dd5c5 100644 --- a/FormatWith/Internal/FormatWithMethods.cs +++ b/FormatWith/Internal/FormatWithMethods.cs @@ -142,7 +142,7 @@ public static FormattableString FormattableWith( } /// - /// Gets an that will return all format parameters used within the format string. + /// Gets an IEnumerable<string> that will return all format parameters used within the format string. /// /// The format string to be parsed /// The character used to begin parameters diff --git a/FormatWith/ReplacementResult.cs b/FormatWith/ReplacementResult.cs index 5580de5..7dd10f5 100644 --- a/FormatWith/ReplacementResult.cs +++ b/FormatWith/ReplacementResult.cs @@ -4,15 +4,33 @@ namespace FormatWith { + /// + /// Represents the result of a substitution for a parameter within a format string. + /// public struct ReplacementResult { + /// + /// Represents the result of a substitution for a parameter within a format string. + /// + /// Represents whether or not the substitution was successful. + /// The new value for the substituted format parameter. public ReplacementResult(bool success, object value) { Success = success; Value = value; } + /// + /// Represents whether or not the substitution was successful. + /// If true, the handler was successfully able to replace this parameter with the substituted value. + /// If false, the substitution failed, and Value will be set to null. + /// public bool Success { get; } + + /// + /// The new value for the substituted format parameter. + /// If Success is false, this should be set to null. + /// public object Value { get; } } } From 9ace7d1b11d7e9692de491a864187d10734e9e39 Mon Sep 17 00:00:00 2001 From: Ryan Crosby Date: Tue, 25 Aug 2020 11:24:25 +1000 Subject: [PATCH 2/3] Update obsolete License URL to License Expression --- FormatWith/FormatWith.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FormatWith/FormatWith.csproj b/FormatWith/FormatWith.csproj index 5359e7e..f4f8e89 100644 --- a/FormatWith/FormatWith.csproj +++ b/FormatWith/FormatWith.csproj @@ -13,7 +13,7 @@ Copyright © Ryan Crosby 2017 - 2020 named string formatter extension NetStandard 2.0 https://github.com/crozone/FormatWith - https://opensource.org/licenses/MIT + MIT true false false From fb8e3c2e8a238cc37d781f39e1994638b09fbc3e Mon Sep 17 00:00:00 2001 From: Ryan Crosby Date: Tue, 25 Aug 2020 11:25:57 +1000 Subject: [PATCH 3/3] Fix formatting of csproj --- FormatWith/FormatWith.csproj | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/FormatWith/FormatWith.csproj b/FormatWith/FormatWith.csproj index f4f8e89..954d538 100644 --- a/FormatWith/FormatWith.csproj +++ b/FormatWith/FormatWith.csproj @@ -1,38 +1,38 @@ - - netstandard2.0 - FormatWith - FormatWith - String extension methods for performing {named} {{parameterized}} string formatting, written for NetStandard 2.0 - FormatWith - FormatWith - FormatWith - 3.0.0 - Ryan Crosby - Copyright © Ryan Crosby 2017 - 2020 - named string formatter extension NetStandard 2.0 - https://github.com/crozone/FormatWith - MIT - true - false - false - false - false - false - false - true - https://github.com/crozone/FormatWith - git - Key:format syntax now supported for FormatWith and FormattableWith - + + netstandard2.0 + FormatWith + FormatWith + String extension methods for performing {named} {{parameterized}} string formatting, written for NetStandard 2.0 + FormatWith + FormatWith + FormatWith + 3.0.0 + Ryan Crosby + Copyright © Ryan Crosby 2017 - 2020 + named string formatter extension NetStandard 2.0 + https://github.com/crozone/FormatWith + MIT + true + false + false + false + false + false + false + true + https://github.com/crozone/FormatWith + git + Key:format syntax now supported for FormatWith and FormattableWith + - - bin\Debug\netstandard2.0\FormatWith.xml - - - - bin\Release\netstandard2.0\FormatWith.xml - + + bin\Debug\netstandard2.0\FormatWith.xml + + + + bin\Release\netstandard2.0\FormatWith.xml +