次の方法で共有


ExtendedProperties.Contains メソッド (Guid)

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
特定の ExtendedProperty オブジェクトが ExtendedProperties コレクションに含まれる場合は 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