This topic has not yet been rated - Rate this topic

TypeConverter.IsValid Method (ITypeDescriptorContext, Object)

.NET Framework 1.1

Returns whether the given value object is valid for this type and for the specified context.

[Visual Basic]
Overloads Public Overridable Function IsValid( _
   ByVal context As ITypeDescriptorContext, _
   ByVal value As Object _
) As Boolean
[C#]
public virtual bool IsValid(
 ITypeDescriptorContext context,
 object value
);
[C++]
public: virtual bool IsValid(
 ITypeDescriptorContext* context,
 Object* value
);
[JScript]
public function IsValid(
   context : ITypeDescriptorContext,
 value : Object
) : Boolean;

Parameters

context
An ITypeDescriptorContext that provides a format context.
value
The Object to test for validity.

Return Value

true if the specified value is valid for this object; otherwise, false.

Remarks

As implemented in this class, this method always returns true.

Use the context parameter to extract additional information about the environment from which this converter is invoked. This parameter can be a null reference (Nothing in Visual Basic), so always check it. Also, properties on the context object can return a null reference (Nothing).

Notes to Inheritors:  Override this method if the type you want to convert supports standard values that can be validated.

Example

For an example on this function, see the sample in TypeConverter.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

TypeConverter Class | TypeConverter Members | System.ComponentModel Namespace | TypeConverter.IsValid Overload List | ITypeDescriptorContext

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.