Поделиться через


ExtendedProperties.Contains - метод (ExtendedProperty)

Обновлен: Ноябрь 2007

Indicates whether the ExtendedProperties collection contains a specific ExtendedProperty object.

Пространство имен:  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

Параметры

Возвращаемое значение

Тип: System.Boolean
true if the ExtendedProperties collection contains a specific ExtendedProperty object; otherwise, false.

Примеры

In this example, each Stroke object in the provided Strokes collection is examined. If a Stroke object contains all of the extended properties in the provided ExtendedProperties collection, the Stroke is modified to display in a different color.

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

См. также

Ссылки

ExtendedProperties Класс

ExtendedProperties - члены

Contains - перегрузка

Microsoft.Ink - пространство имен

ExtendedProperty