@@ -58,19 +58,61 @@ public static void Register (ParserOptions options = null)
58
58
TypeDescriptor . AddAttributes ( typeof ( InternetAddressList ) , new TypeConverterAttribute ( typeof ( InternetAddressListConverter ) ) ) ;
59
59
}
60
60
61
- /// <inheritdoc/>
61
+ /// <summary>
62
+ /// Initializes a new instance of the <see cref="InternetAddressListConverter"/> class.
63
+ /// </summary>
64
+ /// <remarks>
65
+ /// Creates a new <see cref="InternetAddressListConverter"/>.
66
+ /// </remarks>
67
+ public InternetAddressListConverter ( )
68
+ {
69
+ }
70
+
71
+ /// <summary>
72
+ /// Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.
73
+ /// </summary>
74
+ /// <remarks>
75
+ /// Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context.
76
+ /// </remarks>
77
+ /// <returns><see langword="true"/> if this converter can perform the conversion; otherwise, <see langword="false"/>.</returns>
78
+ /// <param name="context">An <see cref="ITypeDescriptorContext"/> that provides a format context.</param>
79
+ /// <param name="sourceType">A <see cref="Type"/> that represents the type you want to convert from.</param>
62
80
public override bool CanConvertFrom ( ITypeDescriptorContext context , Type sourceType )
63
81
{
64
82
return sourceType == typeof ( string ) || base . CanConvertFrom ( context , sourceType ) ;
65
83
}
66
84
67
- /// <inheritdoc/>
85
+ /// <summary>
86
+ /// Returns whether this converter can convert the object to the specified type, using the specified context.
87
+ /// </summary>
88
+ /// <remarks>
89
+ /// <para>Use the <paramref name="context"/> parameter to extract additional information about the environment
90
+ /// from which this converter is invoked. This parameter can be <see langword="null"/>, so always check it. Also,
91
+ /// properties on the context object can return <see langword="null"/>.</para>
92
+ /// <para>If <paramref name="destinationType"/> is a string, the default implementation of <see cref="CanConvertTo"/>
93
+ /// always returns <see langword="true"/>.</para>
94
+ /// </remarks>
95
+ /// <returns><see langword="true"/> if this converter can perform the conversion; otherwise, <see langword="false"/>.</returns>
96
+ /// <param name="context">An <see cref="ITypeDescriptorContext"/> that provides a format context.</param>
97
+ /// <param name="destinationType">A <see cref="Type"/> that represents the type you want to convert to.</param>
68
98
public override bool CanConvertTo ( ITypeDescriptorContext context , Type destinationType )
69
99
{
70
100
return destinationType == typeof ( string ) || base . CanConvertTo ( context , destinationType ) ;
71
101
}
72
102
73
- /// <inheritdoc/>
103
+ /// <summary>
104
+ /// Converts the given object to the type of this converter, using the specified context and culture information.
105
+ /// </summary>
106
+ /// <remarks>
107
+ /// Converts the given object to the type of this converter, using the specified context and culture information.
108
+ /// </remarks>
109
+ /// <returns>An <see cref="Object"/> that represents the converted value.</returns>
110
+ /// <param name="context">An <see cref="ITypeDescriptorContext"/> that provides a format context.</param>
111
+ /// <param name="culture">The <see cref="CultureInfo"/> to use as the current culture.</param>
112
+ /// <param name="value">The <see cref="Object"/> to convert.</param>
113
+ /// <exception cref="NotSupportedException">
114
+ /// The conversion cannot be performed.
115
+ /// </exception>
74
116
public override object ConvertFrom ( ITypeDescriptorContext context , CultureInfo culture , object value )
75
117
{
76
118
if ( value is string text )
@@ -79,7 +121,23 @@ public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo
79
121
return base . ConvertFrom ( context , culture , value ) ;
80
122
}
81
123
82
- /// <inheritdoc/>
124
+ /// <summary>
125
+ /// Converts the given value object to the specified type, using the specified context and culture information.
126
+ /// </summary>
127
+ /// <remarks>
128
+ /// Converts the given value object to the specified type, using the specified context and culture information.
129
+ /// </remarks>
130
+ /// <returns>An <see cref="Object"/> that represents the converted value.</returns>
131
+ /// <param name="context">An <see cref="ITypeDescriptorContext"/> that provides a format context.</param>
132
+ /// <param name="culture">A <see cref="CultureInfo"/>. If <see langword="null"/>, the current culture is assumed.</param>
133
+ /// <param name="value">The <see cref="Object"/> to convert.</param>
134
+ /// <param name="destinationType">The <see cref="Type"/> to convert the value to.</param>
135
+ /// <exception cref="ArgumentNullException">
136
+ /// <paramref name="destinationType"/> is <see langword="null"/>.
137
+ /// </exception>
138
+ /// <exception cref="NotSupportedException">
139
+ /// The conversion cannot be performed.
140
+ /// </exception>
83
141
public override object ConvertTo ( ITypeDescriptorContext context , CultureInfo culture , object value , Type destinationType )
84
142
{
85
143
if ( destinationType == typeof ( string ) && value is InternetAddressList list )
@@ -88,7 +146,21 @@ public override object ConvertTo (ITypeDescriptorContext context, CultureInfo cu
88
146
return base . ConvertTo ( context , culture , value , destinationType ) ;
89
147
}
90
148
91
- /// <inheritdoc/>
149
+ /// <summary>
150
+ /// Returns whether the given value object is valid for this type and for the specified context.
151
+ /// </summary>
152
+ /// <remarks>
153
+ /// <para>Use the <paramref name="context"/> parameter to extract additional information about the environment from which
154
+ /// this converter is invoked. This parameter can be <see langword="null"/>, so always check it. Also, properties on the
155
+ /// context object can return <see langword="null"/>.</para>
156
+ /// <para>Starting in .NET Framework 4, the <see cref="IsValid"/> method catches exceptions from the <see cref="CanConvertFrom"/>
157
+ /// and <see cref="ConvertFrom"/> methods. If the input value type causes <see cref="CanConvertFrom"/> to return <see langword="false"/>,
158
+ /// or if the input value causes <see cref="ConvertFrom"/> to raise an exception, the <see cref="IsValid"/> method returns
159
+ /// <see langword="false"/>.</para>
160
+ /// </remarks>
161
+ /// <returns><see langword="true"/> if the specified value is valid for this object; otherwise, <see langword="false"/>.</returns>
162
+ /// <param name="context">An <see cref="ITypeDescriptorContext"/> that provides a format context.</param>
163
+ /// <param name="value">The <see cref="Object"/> to test for validity.</param>
92
164
public override bool IsValid ( ITypeDescriptorContext context , object value )
93
165
{
94
166
if ( value is string text )
0 commit comments