@@ -26,8 +26,8 @@ private static readonly IReadOnlyDictionary<string, bool> BooleanMap
2626 /// <summary>
2727 /// Gets the boolean value of the specified BindEvent<string> object.
2828 /// </summary>
29- /// <param name="ev ">
30- /// The BindEvent <string> object that provides a boolean value.
29+ /// <param name="result ">
30+ /// The BindResult <string> object that provides a boolean value.
3131 /// </param>
3232 /// <param name="defaultValue">
3333 /// The default value.
@@ -36,19 +36,21 @@ private static readonly IReadOnlyDictionary<string, bool> BooleanMap
3636 /// The boolean value if the specified BindEvent has a value and the value
3737 /// is parsed successfully and valid, the default value otherwise.
3838 /// </returns>
39- public static bool ToBooleanValue ( BindEvent < string > ? ev , bool defaultValue )
39+ public static bool ToBooleanValue (
40+ BindResult < string > ? result ,
41+ bool defaultValue )
4042 {
41- return ( ev is null )
43+ return ( result is null )
4244 ? defaultValue
43- : ParseBoolean ( ev . Value ) ?? defaultValue ;
45+ : ParseBoolean ( result . Value ) ?? defaultValue ;
4446 }
4547
4648 /// <summary>
4749 /// Gets the integer value of the specified BindEvent<string>
4850 /// object.
4951 /// </summary>
5052 /// <param name="ev">
51- /// The BindEvent <string> object that provides an integer value.
53+ /// The BindResult <string> object that provides an integer value.
5254 /// </param>
5355 /// <param name="defaultValue">
5456 /// The default value.
@@ -63,7 +65,7 @@ public static bool ToBooleanValue(BindEvent<string>? ev, bool defaultValue)
6365 /// otherwise.
6466 /// </returns>
6567 public static int ToIntValue (
66- BindEvent < string > ? ev ,
68+ BindResult < string > ? ev ,
6769 int defaultValue ,
6870 Func < int , bool > isValidValue )
6971 {
@@ -81,8 +83,8 @@ public static int ToIntValue(
8183 /// Validates the specified BindEvent<string> object and gets the
8284 /// tuples representing the error information.
8385 /// </summary>
84- /// <param name="ev ">
85- /// The BindEvent <string> object.
86+ /// <param name="result ">
87+ /// The BindResult <string> object.
8688 /// </param>
8789 /// <param name="invalidBooleanValueError">
8890 /// The error message when it is unable to parse a boolean value.
@@ -92,25 +94,25 @@ public static int ToIntValue(
9294 /// object can be parsed successfully. Otherwise, the errors.
9395 /// </returns>
9496 public static IEnumerable < WhereWhy > ValidateBoolean (
95- BindEvent < string > ? ev ,
97+ BindResult < string > ? result ,
9698 string invalidBooleanValueError )
9799 {
98- if ( ev is null )
100+ if ( result is null )
99101 {
100102 return NoError ;
101103 }
102- var v = ParseBoolean ( ev . Value ) ;
104+ var v = ParseBoolean ( result . Value ) ;
103105 return ! v . HasValue
104- ? [ ToError ( ev , invalidBooleanValueError ) ]
106+ ? [ ToError ( result , invalidBooleanValueError ) ]
105107 : NoError ;
106108 }
107109
108110 /// <summary>
109111 /// Validates the specified BindEvent<string> object and gets the
110112 /// tuples representing the error information.
111113 /// </summary>
112- /// <param name="ev ">
113- /// The BindEvent <string> object.
114+ /// <param name="result ">
115+ /// The BindResult <string> object.
114116 /// </param>
115117 /// <param name="isValidValue">
116118 /// The function that returns whether a value of the argument is valid or
@@ -127,22 +129,24 @@ public static IEnumerable<WhereWhy> ValidateBoolean(
127129 /// can be parsed successfully. Otherwise, the errors.
128130 /// </returns>
129131 public static IEnumerable < WhereWhy > ValidateInt (
130- BindEvent < string > ? ev ,
132+ BindResult < string > ? result ,
131133 Func < int , bool > isValidValue ,
132134 string invalidIntegerValueError ,
133135 string invalidValueRangeError )
134136 {
135- return ( ev is null )
137+ return ( result is null )
136138 ? NoError
137- : ( ParseInt ( ev . Value ) is not { } v )
138- ? [ ToError ( ev , invalidIntegerValueError ) ]
139+ : ( ParseInt ( result . Value ) is not { } v )
140+ ? [ ToError ( result , invalidIntegerValueError ) ]
139141 : ! isValidValue ( v )
140- ? [ ToError ( ev , invalidValueRangeError ) ]
142+ ? [ ToError ( result , invalidValueRangeError ) ]
141143 : NoError ;
142144 }
143145
144- private static WhereWhy ToError ( BindEvent < string > ev , string message )
145- => new ( ev . Line , ev . Column , $ "{ message } : '{ ev . Value } '") ;
146+ private static WhereWhy ToError (
147+ BindResult < string > result ,
148+ string message )
149+ => new ( result . Line , result . Column , $ "{ message } : '{ result . Value } '") ;
146150
147151 /// <summary>
148152 /// Gets the integer value that results from parsing the specified string.
0 commit comments