![]() | Internet |
public override bool IsValid( ITypeDescriptorContext context, Object value )
Use the context 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 IsValid(ITypeDescriptorContext, Object) method catches exceptions from the CanConvertFrom(ITypeDescriptorContext, Type) and ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) methods. If the input value type causes CanConvertFrom(ITypeDescriptorContext, Type) to return , or if the input value causes ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) to raise an exception, the IsValid(ITypeDescriptorContext, Object) method returns .