XamlTypeInvoker.GetAddMethod(XamlType) 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 the relevant Add
method for a XamlTypeInvoker that is relevant to a collection or dictionary.
public:
virtual System::Reflection::MethodInfo ^ GetAddMethod(System::Xaml::XamlType ^ contentType);
public virtual System.Reflection.MethodInfo GetAddMethod (System.Xaml.XamlType contentType);
abstract member GetAddMethod : System.Xaml.XamlType -> System.Reflection.MethodInfo
override this.GetAddMethod : System.Xaml.XamlType -> System.Reflection.MethodInfo
Public Overridable Function GetAddMethod (contentType As XamlType) As MethodInfo
Parameters
Returns
CLR MethodInfo information for the Add
method, or null.
Exceptions
contentType
is null
.
Remarks
This method should return null
for cases where the XamlType for this XamlTypeInvoker is not a writeable collection or dictionary. Specifically, should return null
for cases where XamlType.LookupCollectionKind returns None
.
Important
If you are not accessing a fully trusted XAML type system, this method has the potential to report false MethodInfo information to callers.
Notes to Inheritors
The base implementation returns null
for cases where a XamlTypeInvoker is based on an unknown XamlType, which includes cases where the UnderlyingType of the XamlType is null
. It also returns null
if ItemType is null
.
XAML collections potentially have more than one Add
method, because a XAML collection can potentially support more than one content type (see AllowedContentTypes, or see ContentWrapperAttribute for information about one implementation of this concept in WPF). The default implementation uses internal logic to return the best match based on the signatures and the type of the supplied contentType
.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기