다음을 통해 공유


ExtendedProperties.Contains 메서드 (Guid)

업데이트: 2007년 11월

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

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

구문

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

returnValue = instance.Contains(id)
public bool Contains(
    Guid id
)
public:
bool Contains(
    Guid id
)
public boolean Contains(
    Guid id
)
public function Contains(
    id : Guid
) : boolean

매개 변수

반환 값

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

예제

이 예제에서는 Strokes 컬렉션의 각 Stroke 개체를 검사합니다. StrokeExtendedProperties에 특수 타임스탬프 GUID 개체와 연결된 속성이 포함되어 있는 경우 ExtendedProperty가 컬렉션에서 제거됩니다.

Private Sub RemoveAllTimeStampProperties()
    ' STROKE_START_GUID and STROKE_END_GUID
    ' are class level string const set via GUID generator
    Dim strokeStartGuid As Guid = New Guid(STROKE_START_GUID)
    Dim strokeEndGuid As Guid = New Guid(STROKE_END_GUID)

    ' access the Strokes property via using statement
    ' to insure that the object mStrokes is disposed when finished
    ' Otherwise, you will have a memory leak
    Using mStrokes As Strokes = mInkObject.Ink.Strokes
        For Each S As Stroke In mStrokes
            If S.ExtendedProperties.Contains(strokeStartGuid) Then
                S.ExtendedProperties.Remove(strokeStartGuid)
            End If
            If S.ExtendedProperties.Contains(strokeEndGuid) Then
                S.ExtendedProperties.Remove(strokeEndGuid)
            End If
        Next
    End Using
End Sub
private void RemoveAllTimeStampProperties()
{
    // STROKE_START_GUID and STROKE_END_GUID
    // are class level string const set via GUID generator
    Guid strokeStartGuid = new Guid(STROKE_START_GUID);
    Guid strokeEndGuid = new Guid(STROKE_END_GUID);

    // access the Strokes property via using statement
    // to insure that the object mStrokes is disposed when finished
    // Otherwise, you will have a memory leak
    using (Strokes mStrokes = mInkObject.Ink.Strokes)
    {
        foreach (Stroke S in mStrokes)
        {
            if (S.ExtendedProperties.Contains(strokeStartGuid))
            {
                S.ExtendedProperties.Remove(strokeStartGuid);
            }
            if (S.ExtendedProperties.Contains(strokeEndGuid))
            {
                S.ExtendedProperties.Remove(strokeEndGuid);
            }
        }
    }
}

플랫폼

Windows Vista

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

ExtendedProperties 클래스

ExtendedProperties 멤버

Contains 오버로드

Microsoft.Ink 네임스페이스

ExtendedProperty