diff --git a/MimeKit/InternetAddressConverter.cs b/MimeKit/InternetAddressConverter.cs index 4ded7411c8..fe651212c7 100644 --- a/MimeKit/InternetAddressConverter.cs +++ b/MimeKit/InternetAddressConverter.cs @@ -58,19 +58,61 @@ public static void Register (ParserOptions options = null) TypeDescriptor.AddAttributes (typeof (InternetAddress), new TypeConverterAttribute (typeof (InternetAddressConverter))); } - /// + /// + /// Initializes a new instance of the class. + /// + /// + /// Creates a new . + /// + public InternetAddressConverter () + { + } + + /// + /// Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. + /// + /// + /// Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. + /// + /// if this converter can perform the conversion; otherwise, . + /// An that provides a format context. + /// A that represents the type you want to convert from. public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) { return sourceType == typeof (string) || base.CanConvertFrom (context, sourceType); } - /// + /// + /// Returns whether this converter can convert the object to the specified type, using the specified context. + /// + /// + /// Use the parameter to extract additional information about the environment + /// from which this converter is invoked. This parameter can be , so always check it. Also, + /// properties on the context object can return . + /// If is a string, the default implementation of + /// always returns . + /// + /// if this converter can perform the conversion; otherwise, . + /// An that provides a format context. + /// A that represents the type you want to convert to. public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) { return destinationType == typeof (string) || base.CanConvertTo (context, destinationType); } - /// + /// + /// Converts the given object to the type of this converter, using the specified context and culture information. + /// + /// + /// Converts the given object to the type of this converter, using the specified context and culture information. + /// + /// An that represents the converted value. + /// An that provides a format context. + /// The to use as the current culture. + /// The to convert. + /// + /// The conversion cannot be performed. + /// public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string text) @@ -79,7 +121,23 @@ public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo return base.ConvertFrom (context, culture, value); } - /// + /// + /// Converts the given value object to the specified type, using the specified context and culture information. + /// + /// + /// Converts the given value object to the specified type, using the specified context and culture information. + /// + /// An that represents the converted value. + /// An that provides a format context. + /// A . If , the current culture is assumed. + /// The to convert. + /// The to convert the value to. + /// + /// is . + /// + /// + /// The conversion cannot be performed. + /// public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof (string) && value is InternetAddress address) @@ -88,7 +146,21 @@ public override object ConvertTo (ITypeDescriptorContext context, CultureInfo cu return base.ConvertTo (context, culture, value, destinationType); } - /// + /// + /// Returns whether the given value object is valid for this type and for the specified context. + /// + /// + /// Use the parameter to extract additional information about the environment from which + /// this converter is invoked. This parameter can be , so always check it. Also, properties on the + /// context object can return . + /// Starting in .NET Framework 4, the method catches exceptions from the + /// and methods. If the input value type causes to return , + /// or if the input value causes to raise an exception, the method returns + /// . + /// + /// if the specified value is valid for this object; otherwise, . + /// An that provides a format context. + /// The to test for validity. public override bool IsValid (ITypeDescriptorContext context, object value) { if (value is string text) diff --git a/MimeKit/InternetAddressListConverter.cs b/MimeKit/InternetAddressListConverter.cs index 431de656cd..16a3d97cf9 100644 --- a/MimeKit/InternetAddressListConverter.cs +++ b/MimeKit/InternetAddressListConverter.cs @@ -58,19 +58,61 @@ public static void Register (ParserOptions options = null) TypeDescriptor.AddAttributes (typeof (InternetAddressList), new TypeConverterAttribute (typeof (InternetAddressListConverter))); } - /// + /// + /// Initializes a new instance of the class. + /// + /// + /// Creates a new . + /// + public InternetAddressListConverter () + { + } + + /// + /// Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. + /// + /// + /// Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. + /// + /// if this converter can perform the conversion; otherwise, . + /// An that provides a format context. + /// A that represents the type you want to convert from. public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) { return sourceType == typeof (string) || base.CanConvertFrom (context, sourceType); } - /// + /// + /// Returns whether this converter can convert the object to the specified type, using the specified context. + /// + /// + /// Use the parameter to extract additional information about the environment + /// from which this converter is invoked. This parameter can be , so always check it. Also, + /// properties on the context object can return . + /// If is a string, the default implementation of + /// always returns . + /// + /// if this converter can perform the conversion; otherwise, . + /// An that provides a format context. + /// A that represents the type you want to convert to. public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) { return destinationType == typeof (string) || base.CanConvertTo (context, destinationType); } - /// + /// + /// Converts the given object to the type of this converter, using the specified context and culture information. + /// + /// + /// Converts the given object to the type of this converter, using the specified context and culture information. + /// + /// An that represents the converted value. + /// An that provides a format context. + /// The to use as the current culture. + /// The to convert. + /// + /// The conversion cannot be performed. + /// public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string text) @@ -79,7 +121,23 @@ public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo return base.ConvertFrom (context, culture, value); } - /// + /// + /// Converts the given value object to the specified type, using the specified context and culture information. + /// + /// + /// Converts the given value object to the specified type, using the specified context and culture information. + /// + /// An that represents the converted value. + /// An that provides a format context. + /// A . If , the current culture is assumed. + /// The to convert. + /// The to convert the value to. + /// + /// is . + /// + /// + /// The conversion cannot be performed. + /// public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof (string) && value is InternetAddressList list) @@ -88,7 +146,21 @@ public override object ConvertTo (ITypeDescriptorContext context, CultureInfo cu return base.ConvertTo (context, culture, value, destinationType); } - /// + /// + /// Returns whether the given value object is valid for this type and for the specified context. + /// + /// + /// Use the parameter to extract additional information about the environment from which + /// this converter is invoked. This parameter can be , so always check it. Also, properties on the + /// context object can return . + /// Starting in .NET Framework 4, the method catches exceptions from the + /// and methods. If the input value type causes to return , + /// or if the input value causes to raise an exception, the method returns + /// . + /// + /// if the specified value is valid for this object; otherwise, . + /// An that provides a format context. + /// The to test for validity. public override bool IsValid (ITypeDescriptorContext context, object value) { if (value is string text)