ServiceDescriptionFormatExtensionCollection.Contains(Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a value indicating whether the specified ServiceDescriptionFormatExtension is a member of the ServiceDescriptionFormatExtensionCollection.
public:
bool Contains(System::Object ^ extension);
public bool Contains (object extension);
member this.Contains : obj -> bool
Public Function Contains (extension As Object) As Boolean
Parameters
- extension
- Object
The ServiceDescriptionFormatExtension for which to check collection membership.
Returns
true
if the ServiceDescriptionFormatExtension is a member of the collection; otherwise, false
.
Examples
// Check for 'myFormatExtension' object in collection.
if ( myCollection->Contains( myFormatExtensionObject ) )
{
// Get index of a 'myFormatExtension' object in collection.
Console::WriteLine( "Index of 'myFormatExtensionObject' is {0} in collection.", myCollection->IndexOf( myFormatExtensionObject ) );
// Remove 'myFormatExtensionObject' element from collection.
myCollection->Remove( myFormatExtensionObject );
Console::WriteLine( "'myFormatExtensionObject' is removed from collection." );
}
// Check for 'myFormatExtension' object in collection.
if(myCollection.Contains(myFormatExtensionObject))
{
// Get index of a 'myFormatExtension' object in collection.
Console.WriteLine("Index of 'myFormatExtensionObject' is "+
"{0} in collection.",
myCollection.IndexOf(myFormatExtensionObject).ToString());
// Remove 'myFormatExtensionObject' element from collection.
myCollection.Remove(myFormatExtensionObject);
Console.WriteLine("'myFormatExtensionObject' is removed"+
" from collection.");
}
' Check for 'myFormatExtension' object in collection.
If myCollection.Contains(myFormatExtensionObject) Then
' Get index of a 'myFormatExtension' object in collection.
Console.WriteLine("Index of 'myFormatExtensionObject' is " + _
"{0} in collection.", myCollection.IndexOf(myFormatExtensionObject).ToString())
' Remove 'myFormatExtensionObject' element from collection.
myCollection.Remove(myFormatExtensionObject)
Console.WriteLine("'myFormatExtensionObject' is removed" + _
" from collection.")
End If
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.