@@ -11,15 +11,19 @@ namespace ReactiveUI;
1111internal static class BindingTypeConverterDispatch
1212{
1313 /// <summary>
14- /// Attempts conversion via the converter's type-only metadata (<see cref="IBindingTypeConverter.FromType"/> and
15- /// <see cref="IBindingTypeConverter.ToType"/>) and object shim (<see cref="IBindingTypeConverter.TryConvertTyped"/>).
14+ /// Attempts to convert a value to the specified target type using the provided binding type converter.
1615 /// </summary>
17- /// <param name="converter">The converter.</param>
18- /// <param name="from">The source value.</param>
19- /// <param name="toType">The target type requested by the caller.</param>
20- /// <param name="conversionHint">Implementation-defined hint.</param>
21- /// <param name="result">The converted result.</param>
22- /// <returns><see langword="true"/> if conversion succeeded; otherwise <see langword="false"/>.</returns>
16+ /// <remarks>The conversion will only be attempted if the converter's ToType matches the specified toType
17+ /// and the runtime type of from matches the converter's FromType (or is compatible with a nullable value type). No
18+ /// exceptions are thrown for conversion failures; instead, the method returns false.</remarks>
19+ /// <param name="converter">The binding type converter to use for the conversion. Cannot be null.</param>
20+ /// <param name="from">The value to convert. May be null if the target type accepts null values.</param>
21+ /// <param name="toType">The target type to convert the value to. Must match the converter's ToType. Cannot be null.</param>
22+ /// <param name="conversionHint">An optional hint object that may influence the conversion process. The meaning of this parameter is determined
23+ /// by the converter implementation.</param>
24+ /// <param name="result">When this method returns, contains the converted value if the conversion succeeded; otherwise, null. This
25+ /// parameter is passed uninitialized.</param>
26+ /// <returns>true if the value was successfully converted; otherwise, false.</returns>
2327 internal static bool TryConvert (
2428 IBindingTypeConverter converter ,
2529 object ? from ,
@@ -64,15 +68,19 @@ internal static bool TryConvert(
6468 }
6569
6670 /// <summary>
67- /// Attempts conversion using a fallback converter.
71+ /// Attempts to convert an object to a specified type using the provided fallback converter.
6872 /// </summary>
69- /// <param name="converter">The fallback converter.</param>
70- /// <param name="fromType">The source runtime type.</param>
71- /// <param name="from">The source value (guaranteed non-null by caller).</param>
72- /// <param name="toType">The target type.</param>
73- /// <param name="conversionHint">Implementation-defined hint.</param>
74- /// <param name="result">The converted result.</param>
75- /// <returns><see langword="true"/> if conversion succeeded; otherwise, <see langword="false"/>.</returns>
73+ /// <remarks>This method delegates the conversion to the specified fallback converter. The result is
74+ /// guaranteed to be non-null only if the conversion succeeds. Callers should check the return value to determine
75+ /// whether the conversion was successful before using the result.</remarks>
76+ /// <param name="converter">The fallback converter to use for the conversion operation. Cannot be null.</param>
77+ /// <param name="fromType">The type of the source object to convert. Used to inform the converter of the input type.</param>
78+ /// <param name="from">The source object to convert. Cannot be null.</param>
79+ /// <param name="toType">The target type to convert the object to. Cannot be null.</param>
80+ /// <param name="conversionHint">An optional hint or context object that may influence the conversion process. May be null.</param>
81+ /// <param name="result">When this method returns, contains the converted object if the conversion succeeded; otherwise, null. This
82+ /// parameter is passed uninitialized.</param>
83+ /// <returns>true if the conversion was successful and the result is non-null; otherwise, false.</returns>
7684 internal static bool TryConvertFallback (
7785 IBindingFallbackConverter converter ,
7886 [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . All ) ] Type fromType ,
@@ -103,22 +111,21 @@ internal static bool TryConvertFallback(
103111 }
104112
105113 /// <summary>
106- /// Unified dispatch method that handles both typed and fallback converters .
114+ /// Attempts to convert an object to a specified target type using the provided converter .
107115 /// </summary>
108- /// <param name="converter">The converter (either <see cref="IBindingTypeConverter"/> or <see cref="IBindingFallbackConverter"/>).</param>
109- /// <param name="fromType">The source runtime type.</param>
110- /// <param name="from">The source value.</param>
111- /// <param name="toType">The target type.</param>
112- /// <param name="conversionHint">Implementation-defined hint.</param>
113- /// <param name="result">The converted result.</param>
114- /// <returns><see langword="true"/> if conversion succeeded; otherwise, <see langword="false"/>.</returns>
115- /// <remarks>
116- /// This method automatically dispatches to the appropriate converter type:
117- /// <list type="bullet">
118- /// <item><description><see cref="IBindingTypeConverter"/> - uses exact pair matching</description></item>
119- /// <item><description><see cref="IBindingFallbackConverter"/> - requires non-null input</description></item>
120- /// </list>
121- /// </remarks>
116+ /// <remarks>This method supports both type-based and fallback converters. If the provided converter does
117+ /// not implement a supported interface or is null, the method returns false and result is set to null. The method
118+ /// does not throw exceptions for failed conversions; instead, it returns false to indicate failure.</remarks>
119+ /// <param name="converter">The converter instance to use for the conversion. Must implement either IBindingTypeConverter or
120+ /// IBindingFallbackConverter. If null or of an unsupported type, the conversion will not be performed.</param>
121+ /// <param name="fromType">The type of the source object to convert. Used to determine the appropriate conversion logic.</param>
122+ /// <param name="from">The source object to convert. May be null if the converter supports null values.</param>
123+ /// <param name="toType">The target type to convert the source object to. Cannot be null.</param>
124+ /// <param name="conversionHint">An optional hint or context object that may influence the conversion process. The interpretation of this value
125+ /// depends on the converter implementation.</param>
126+ /// <param name="result">When this method returns, contains the converted value if the conversion succeeded; otherwise, null. This
127+ /// parameter is passed uninitialized.</param>
128+ /// <returns>true if the conversion was successful and result contains the converted value; otherwise, false.</returns>
122129 internal static bool TryConvertAny (
123130 object ? converter ,
124131 [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . All ) ] Type fromType ,
0 commit comments