表示 ExtendedProperties 集合是否包含特定的 ExtendedProperty 物件。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public Function Contains ( _
ep As ExtendedProperty _
) As Boolean
'用途
Dim instance As ExtendedProperties
Dim ep As ExtendedProperty
Dim returnValue As Boolean
returnValue = instance.Contains(ep)
public bool Contains(
ExtendedProperty ep
)
public:
bool Contains(
ExtendedProperty^ ep
)
public boolean Contains(
ExtendedProperty ep
)
public function Contains(
ep : ExtendedProperty
) : boolean
參數
- ep
型別:Microsoft.Ink.ExtendedProperty
要檢查的 ExtendedProperty 物件。
傳回值
型別:System.Boolean
如果 ExtendedProperties 集合包含特定的 ExtendedProperty 物件,則為 true,否則為 false。
範例
這個範例會檢查提供的 Strokes 集合中的每個 Stroke 物件。如果 Stroke 物件包含提供之 ExtendedProperties 集合中的所有擴充屬性,便會將 Stroke 修改為以不同的色彩顯示。
Private Sub HighlightLikeStrokes(ByVal ep As ExtendedProperties, ByVal theStrokes As Strokes)
If ep.Count > 0 Then
For Each theStroke As Stroke In theStrokes
Dim containsCount As Integer = 0
For k As Integer = 0 To ep.Count
If theStroke.ExtendedProperties.Contains(ep(k)) Then
containsCount += 1
End If
Next
' If all the extended properties are there, color the stroke blue
If containsCount = ep.Count Then
theStroke.DrawingAttributes.Color = Color.PowderBlue
End If
Next
mInkOverlay.AttachedControl.Invalidate()
End If
End Sub
private void HighlightLikeStrokes(ExtendedProperties ep, Strokes theStrokes)
{
if (ep.Count > 0)
{
foreach (Stroke theStroke in theStrokes)
{
int containsCount = 0;
for (int k = 0; k < ep.Count; k++)
{
if (theStroke.ExtendedProperties.Contains(ep[k]))
{
containsCount++;
}
}
// If all the extended properties are there, color the stroke blue
if (containsCount == ep.Count)
{
theStroke.DrawingAttributes.Color = Color.PowderBlue;
}
}
mInkOverlay.AttachedControl.Invalidate();
}
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0