ValuePattern.ValueProperty フィールド
定義
public: static initonly System::Windows::Automation::AutomationProperty ^ ValueProperty;
public static readonly System.Windows.Automation.AutomationProperty ValueProperty;
staticval mutable ValueProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly ValueProperty As AutomationProperty
フィールド値
例
次の例では、 ValuePattern ターゲットコントロールから取得したオブジェクトが、現在のプロパティ値を取得する関数に渡され ValuePattern ます。In the following example, a ValuePattern object obtained from a target control is passed into a function that retrieves the current ValuePattern property values.
///--------------------------------------------------------------------
/// <summary>
/// Gets the current property values from target.
/// </summary>
/// <param name="valuePattern">
/// A ValuePattern control pattern obtained from
/// an automation element representing a target control.
/// </param>
/// <param name="automationProperty">
/// The automation property of interest.
/// </param>
///--------------------------------------------------------------------
private object GetValueProperty(
ValuePattern valuePattern,
AutomationProperty automationProperty)
{
if (valuePattern == null || automationProperty == null)
{
throw new ArgumentNullException("Argument cannot be null.");
}
if (automationProperty.Id ==
ValuePattern.ValueProperty.Id)
{
return valuePattern.Current.Value;
}
return null;
}
'''--------------------------------------------------------------------
''' <summary>
''' Gets the current property values from target.
''' </summary>
''' <param name="valuePattern">
''' A ValuePattern control pattern obtained from
''' an automation element representing a target control.
''' </param>
''' <param name="automationProperty">
''' The automation property of interest.
''' </param>
'''--------------------------------------------------------------------
Private Function GetValueProperty( _
ByVal valuePattern As ValuePattern, _
ByVal automationProperty As AutomationProperty) As Object
If (valuePattern Is Nothing Or automationProperty Is Nothing) Then
Throw New ArgumentNullException("Argument cannot be null.")
End If
If automationProperty.Id = valuePattern.ValueProperty.Id Then
Return valuePattern.Current.Value
End If
Return Nothing
End Function 'GetValueProperty
注釈
この識別子は、UI オートメーションクライアントアプリケーションによって使用されます。This identifier is used by UI Automation client applications. UI オートメーションプロバイダーでは、の同等のフィールドを使用する必要があり ValuePatternIdentifiers ます。UI Automation providers should use the equivalent field in ValuePatternIdentifiers.