diff --git a/FormatWith/FormatWith.csproj b/FormatWith/FormatWith.csproj index e3b65ec..91ab9b2 100644 --- a/FormatWith/FormatWith.csproj +++ b/FormatWith/FormatWith.csproj @@ -1,41 +1,41 @@ - - 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 - https://opensource.org/licenses/MIT - true - false - false - false - false - false - false - true - https://github.com/crozone/FormatWith - git - Key:format syntax now supported for FormatWith and FormattableWith - true - FormatWith-Release.snk - false - + + 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 + true + FormatWith-Release.snk + false + - - bin\Debug\netstandard2.0\FormatWith.xml - - - - bin\Release\netstandard2.0\FormatWith.xml - + + bin\Debug\netstandard2.0\FormatWith.xml + + + + bin\Release\netstandard2.0\FormatWith.xml + 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; } } }