다음을 통해 공유


StylusPointDescription.HasProperty(StylusPointProperty) 메서드

정의

현재 StylusPointDescription에 지정된 속성이 있는지 여부를 나타내는 값을 반환합니다.

public:
 bool HasProperty(System::Windows::Input::StylusPointProperty ^ stylusPointProperty);
public bool HasProperty (System.Windows.Input.StylusPointProperty stylusPointProperty);
member this.HasProperty : System.Windows.Input.StylusPointProperty -> bool
Public Function HasProperty (stylusPointProperty As StylusPointProperty) As Boolean

매개 변수

stylusPointProperty
StylusPointProperty

StylusPointProperty에서 확인할 StylusPointDescription입니다.

반환

StylusPointDescription에 지정된 StylusPointProperty가 있으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 속성에서에 대 한 정보는 StylusPointDescription. 에 StylusMove 이벤트가 이벤트 처리기에 연결 되어 있다고 합니다.

void inkCanvas1_StylusMove(object sender, StylusEventArgs e)
{
    StylusPointCollection points = e.GetStylusPoints(inkCanvas1);
    StylusPointDescription description = points.Description;
    StringWriter normalPressureInfo = new StringWriter();

    if (description.HasProperty(StylusPointProperties.NormalPressure))
    {
        StylusPointPropertyInfo propertyInfo = 
            description.GetPropertyInfo(StylusPointProperties.NormalPressure);

        normalPressureInfo.WriteLine("  Guid = {0}", propertyInfo.Id.ToString());
        normalPressureInfo.Write("  Min = {0}", propertyInfo.Minimum.ToString());
        normalPressureInfo.Write("  Max = {0}", propertyInfo.Maximum.ToString());
        normalPressureInfo.Write("  Unit = {0}", propertyInfo.Unit.ToString());
        normalPressureInfo.WriteLine("  Res = {0}", propertyInfo.Resolution.ToString());
    }
}
Private Sub inkCanvas1_StylusMove(ByVal sender As Object, ByVal e As StylusEventArgs)
    Dim points As StylusPointCollection = e.GetStylusPoints(inkCanvas1)
    Dim description As StylusPointDescription = points.Description
    Dim normalPressureInfo As New StringWriter()

    If description.HasProperty(StylusPointProperties.NormalPressure) Then

        Dim propertyInfo As StylusPointPropertyInfo = _
            description.GetPropertyInfo(StylusPointProperties.NormalPressure)

        normalPressureInfo.WriteLine("  Guid = {0}", propertyInfo.Id.ToString())
        normalPressureInfo.Write("  Min = {0}", propertyInfo.Minimum.ToString())
        normalPressureInfo.Write("  Max = {0}", propertyInfo.Maximum.ToString())
        normalPressureInfo.Write("  Unit = {0}", propertyInfo.Unit.ToString())
        normalPressureInfo.WriteLine("  Res = {0}", propertyInfo.Resolution.ToString())
    End If

End Sub

적용 대상