KeysConverter.CanConvertFrom(ITypeDescriptorContext, Type) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a value indicating whether this converter can convert an object in the specified source type to the native type of the converter using the specified context.
public:
override bool CanConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, Type ^ sourceType);
public override bool CanConvertFrom (System.ComponentModel.ITypeDescriptorContext context, Type sourceType);
public override bool CanConvertFrom (System.ComponentModel.ITypeDescriptorContext? context, Type sourceType);
override this.CanConvertFrom : System.ComponentModel.ITypeDescriptorContext * Type -> bool
Public Overrides Function CanConvertFrom (context As ITypeDescriptorContext, sourceType As Type) As Boolean
Parameters
- context
- ITypeDescriptorContext
An ITypeDescriptorContext that provides a format context, which can be used to extract additional information about the environment this converter is being invoked from. This parameter or properties of this parameter can be null
.
Returns
true
if the conversion can be performed; otherwise, false
.
Remarks
The CanConvertFrom method is specialized to return true
if the sourceType
parameter is of type String or Enum array; otherwise, it defers evaluation to the base implementation of this method.
Notes to Inheritors
Override this method to provide your own conversion requirements.
The context can be used to extract additional information about the environment this converter is being invoked from. This may be null
, so you should always check. Also, properties on the context object may also return null
.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기