다음을 통해 공유


ExtendedProperties.Contains 메서드 (ExtendedProperty)

업데이트: 2007년 11월

ExtendedProperties 컬렉션에 특정 ExtendedProperty 개체가 들어 있는지 여부를 나타냅니다.

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink(Microsoft.Ink.dll)

구문

‘선언
Public Function Contains ( _
    ep As ExtendedProperty _
) As Boolean
‘사용 방법
Dim instance As ExtendedProperties
Dim ep As ExtendedProperty
Dim returnValue As Boolean

returnValue = instance.Contains(ep)
public bool Contains(
    ExtendedProperty ep
)
public:
bool Contains(
    ExtendedProperty^ ep
)
public boolean Contains(
    ExtendedProperty ep
)
public function Contains(
    ep : ExtendedProperty
) : boolean

매개 변수

반환 값

형식: System.Boolean
ExtendedProperties 컬렉션에 특정 ExtendedProperty 개체가 포함되어 있으면 true이고, 그렇지 않으면 false입니다.

예제

이 예제에서는 제공된 Strokes 컬렉션의 각 Stroke 개체를 검사합니다. Stroke 개체에 제공된 ExtendedProperties 컬렉션의 모든 확장된 속성이 들어 있지 않은 경우 Stroke가 다른 색으로 표시되도록 수정됩니다.

Private Sub HighlightLikeStrokes(ByVal ep As ExtendedProperties, ByVal theStrokes As Strokes)
    If ep.Count > 0 Then
        For Each theStroke As Stroke In theStrokes
            Dim containsCount As Integer = 0
            For k As Integer = 0 To ep.Count
                If theStroke.ExtendedProperties.Contains(ep(k)) Then
                    containsCount += 1
                End If
            Next
            ' If all the extended properties are there, color the stroke blue
            If containsCount = ep.Count Then
                theStroke.DrawingAttributes.Color = Color.PowderBlue
            End If
        Next
        mInkOverlay.AttachedControl.Invalidate()
    End If
End Sub
private void HighlightLikeStrokes(ExtendedProperties ep, Strokes theStrokes)
{
    if (ep.Count > 0)
    {
        foreach (Stroke theStroke in theStrokes)
        {
            int containsCount = 0;
            for (int k = 0; k < ep.Count; k++)
            {
                if (theStroke.ExtendedProperties.Contains(ep[k]))
                {
                    containsCount++;
                }
            }
            // If all the extended properties are there, color the stroke blue
            if (containsCount == ep.Count)
            {
                theStroke.DrawingAttributes.Color = Color.PowderBlue;
            }
        }
        mInkOverlay.AttachedControl.Invalidate();
    }
}

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

ExtendedProperties 클래스

ExtendedProperties 멤버

Contains 오버로드

Microsoft.Ink 네임스페이스

ExtendedProperty