DesignerVerbCollection.Contains(DesignerVerb) メソッド

定義

指定した DesignerVerb がコレクション内に存在するかどうかを示す値を取得します。

C#
public bool Contains (System.ComponentModel.Design.DesignerVerb value);
C#
public bool Contains (System.ComponentModel.Design.DesignerVerb? value);

パラメーター

value
DesignerVerb

コレクション内で検索される DesignerVerb

戻り値

指定したオブジェクトがコレクション内に存在する場合は true。それ以外の場合は false

次の例では、 メソッドを Contains 使用して特定 DesignerVerb のオブジェクトの存在を検索し、その後、見つかったインデックス値を取得します。

C#
// Tests for the presence of a DesignerVerb in the collection, 
// and retrieves its index if it is found.
DesignerVerb testVerb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
int itemIndex = -1;
if( collection.Contains( testVerb ) )
    itemIndex = collection.IndexOf( testVerb );

適用対象

製品 バージョン
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1