RangeValuePattern.RangeValuePatternInformation.Value 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
UI 자동화 요소의 현재 값을 가져옵니다.
public:
property double Value { double get(); };
public double Value { get; }
member this.Value : double
Public ReadOnly Property Value As Double
속성 값
UI 자동화 요소의 현재 값이거나 null
요소가 지원하지 Value않는 경우입니다. 기본값은 0.0입니다.
예제
다음 예제에서는 RangeValuePattern 대상 컨트롤에서 가져온 개체를 현재 검색 하는 함수에 전달 RangeValuePattern 속성 값입니다.
///--------------------------------------------------------------------
/// <summary>
/// Gets the current property values from target.
/// </summary>
/// <param name="rangeValuePattern">
/// A RangeValuePattern control pattern obtained from
/// an automation element representing a target control.
/// </param>
/// <param name="automationProperty">
/// The automation property of interest.
/// </param>
///--------------------------------------------------------------------
private object GetRangeValueProperty(
RangeValuePattern rangeValuePattern,
AutomationProperty automationProperty)
{
if (rangeValuePattern == null || automationProperty == null)
{
throw new ArgumentException("Argument cannot be null.");
}
if (automationProperty.Id ==
RangeValuePattern.MinimumProperty.Id)
{
return rangeValuePattern.Current.Minimum;
}
if (automationProperty.Id ==
RangeValuePattern.MaximumProperty.Id)
{
return rangeValuePattern.Current.Maximum;
}
if (automationProperty.Id ==
RangeValuePattern.SmallChangeProperty.Id)
{
return rangeValuePattern.Current.SmallChange;
}
if (automationProperty.Id ==
RangeValuePattern.LargeChangeProperty.Id)
{
return rangeValuePattern.Current.LargeChange;
}
if (automationProperty.Id ==
RangeValuePattern.ValueProperty.Id)
{
return rangeValuePattern.Current.Value;
}
return null;
}
'''--------------------------------------------------------------------
''' <summary>
''' Gets the current property values from target.
''' </summary>
''' <param name="rangeValuePattern">
''' A RangeValuePattern control pattern obtained from
''' an automation element representing a target control.
''' </param>
''' <param name="automationProperty">
''' The automation property of interest.
''' </param>
'''--------------------------------------------------------------------
Private Function GetRangeValueProperty( _
ByVal rangeValuePattern As RangeValuePattern, _
ByVal automationProperty As AutomationProperty) As Object
If (rangeValuePattern Is Nothing Or _
automationProperty Is Nothing) Then
Throw New ArgumentException("Argument cannot be null.")
End If
If automationProperty.Id = _
rangeValuePattern.MinimumProperty.Id Then
Return rangeValuePattern.Current.Minimum
End If
If automationProperty.Id = _
rangeValuePattern.MaximumProperty.Id Then
Return rangeValuePattern.Current.Maximum
End If
If automationProperty.Id = _
rangeValuePattern.SmallChangeProperty.Id Then
Return rangeValuePattern.Current.SmallChange
End If
If automationProperty.Id = _
rangeValuePattern.LargeChangeProperty.Id Then
Return rangeValuePattern.Current.LargeChange
End If
If automationProperty.Id = _
rangeValuePattern.ValueProperty.Id Then
Return rangeValuePattern.Current.Value
End If
Return Nothing
End Function 'GetRangeValueProperty