LowerCaseStringConverter.CanConvertTo(ITypeDescriptorContext, Type) Método
Definição
Determina se um objeto pode ser convertido em uma cadeia de caracteres minúscula com base nos parâmetros especificados.Determines whether an object can be converted to a lowercase string based on the specified parameters.
public:
override bool CanConvertTo(System::ComponentModel::ITypeDescriptorContext ^ ctx, Type ^ type);
public override bool CanConvertTo (System.ComponentModel.ITypeDescriptorContext ctx, Type type);
override this.CanConvertTo : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertTo (ctx As ITypeDescriptorContext, type As Type) As Boolean
Parâmetros
Um objeto que implementa a interface do ITypeDescriptorContext.An object that implements the ITypeDescriptorContext interface.
- type
- Type
O tipo de objeto a converter.The type of object to convert.
Retornos
true se os parâmetros descreverem um objeto que possa ser convertido em um objeto de cadeia de caracteres em minúsculas; caso contrário, false.true if the parameters describe an object that can be converted to a lowercase string object; otherwise, false.
Exemplos
O exemplo a seguir demonstra como usar esse método.The following example demonstrates how to use this method.
// CanConvertTo method.
Console.WriteLine("CanConvertTo: {0}",
myLCStrConverter.CanConvertTo(ctx, testStrVal.GetType()));
' CanConvertTo method.
Console.WriteLine("CanConvertTo: {0}", _
myLCStrConverter.CanConvertTo(ctx, testStrVal.GetType()))
Comentários
Esse método usa um objeto que implementa a ITypeDescriptorContext interface como o ctx parâmetro.This method uses an object that implements the ITypeDescriptorContext interface as the ctx parameter. Essa interface fornece informações contextuais sobre um componente.This interface provides contextual information about a component. Normalmente, essa interface é usada em tempo de design para fornecer informações sobre um contêiner de tempo de design.Typically, this interface is used at design time to provide information about a design-time container. O ITypeDescriptorContext é normalmente usado na conversão de tipo.The ITypeDescriptorContext is commonly used in type conversion. Substitua esse método em uma classe derivada se o comportamento personalizado for necessário.Override this method in a derived class if custom behavior is required.