表示 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
參數
- id
型別:System.Guid
要檢查之 ExtendedProperty 物件的全域唯一識別項 (GUID)。
傳回值
型別:System.Boolean
如果 ExtendedProperties 集合包含特定的 ExtendedProperty 物件,則為 true,否則為 false。
範例
這個範例會檢查 Strokes 集合中的每個 Stroke 物件。如果 Stroke 的 ExtendedProperties 包含與特殊時間戳記 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