次の方法で共有


ExtendedProperties.Contains メソッド (ExtendedProperty)

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

パラメータ

戻り値

型 : System.Boolean
特定の ExtendedProperty オブジェクトが ExtendedProperties コレクションに含まれる場合は true。それ以外の場合は false。

この例では、提供された Strokes コレクションの各 Stroke オブジェクトを調べます。提供された ExtendedProperties コレクションで、Stroke オブジェクトにすべての拡張プロパティが含まれている場合は、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

参照

参照

ExtendedProperties クラス

ExtendedProperties メンバ

Contains オーバーロード

Microsoft.Ink 名前空間

ExtendedProperty