IRawElementProviderSimple.GetPatternProvider(Int32) 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.
Retrieves an object that provides support for a control pattern on a UI Automation element.
public:
System::Object ^ GetPatternProvider(int patternId);
public object GetPatternProvider (int patternId);
abstract member GetPatternProvider : int -> obj
Public Function GetPatternProvider (patternId As Integer) As Object
Parameters
- patternId
- Int32
Identifier of the pattern.
Returns
Object that implements the pattern interface, or null
if the pattern is not supported.
Examples
The following example shows an implementation of GetPatternProvider for a provider that supports only InvokePattern.
/// <summary>
/// Returns the object that supports the specified pattern.
/// </summary>
/// <param name="patternId">ID of the pattern.</param>
/// <returns>Object that implements IInvokeProvider.</returns>
object IRawElementProviderSimple.GetPatternProvider(int patternId)
{
if (patternId == InvokePatternIdentifiers.Pattern.Id)
{
// Return an object that implements IInvokeProvider.
return myInvokePatternProvider;
}
else
{
return null;
}
}
''' <summary>
''' Returns the object that supports the specified pattern.
''' </summary>
''' <param name="patternId">ID of the pattern.</param>
''' <returns>Object that implements IInvokeProvider.</returns>
Function GetPatternProvider(ByVal patternId As Integer) As Object _
Implements IRawElementProviderSimple.GetPatternProvider
If patternId = InvokePatternIdentifiers.Pattern.Id Then
' Return an object that implements IInvokeProvider.
Return myInvokePatternProvider
Else
Return Nothing
End If
End Function 'IRawElementProviderSimple.GetPatternProvider
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET