ExtendedProperties.Contains - метод (Guid)
Обновлен: Ноябрь 2007
Indicates whether the ExtendedProperties collection contains a specific ExtendedProperty object.
Пространство имен: 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
Параметры
- id
Тип: System.Guid
The globally unique identifier (GUID) of the ExtendedProperty object to check for.
Возвращаемое значение
Тип: System.Boolean
true if the ExtendedProperties collection contains a specific ExtendedProperty object; otherwise, false.
Примеры
In this example, each Stroke object in a Strokes collection is examined. If the ExtendedProperties of the Stroke contains properties associated with special timestamp Guid objects, the ExtendedProperty is removed from the 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);
}
}
}
}
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0