Partager via


ExtendedProperties.Contains, méthode (Guid)

Mise à jour : November 2007

Indique si la collection ExtendedProperties contient un objet ExtendedProperty donné.

Espace de noms :  Microsoft.Ink
Assembly :  Microsoft.Ink (dans Microsoft.Ink.dll)

Syntaxe

'Déclaration
Public Function Contains ( _
    id As Guid _
) As Boolean
'Utilisation
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

Paramètres

Valeur de retour

Type : System.Boolean
true si la collection ExtendedProperties contient un objet ExtendedProperty spécifique ; sinon, false.

Exemples

Dans cet exemple, chaque objet Stroke d'une collection Strokes est examiné. Si le ExtendedProperties du Stroke contient des propriétés associées à des objets Guid d'horodatage spécial, le ExtendedProperty est supprimé de la collection.

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);
            }
        }
    }
}

Plateformes

Windows Vista

Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.

Informations de version

.NET Framework

Pris en charge dans : 3.0

Voir aussi

Référence

ExtendedProperties, classe

Membres ExtendedProperties

Contains, surcharge

Microsoft.Ink, espace de noms

ExtendedProperty