This documentation is archived and is not being maintained.
ServiceDescriptionFormatExtensionCollection.Contains Method
.NET Framework 1.1
Returns a value indicating whether the specified ServiceDescriptionFormatExtension is a member of the ServiceDescriptionFormatExtensionCollection.
[Visual Basic] Public Function Contains( _ ByVal extension As Object _ ) As Boolean [C#] public bool Contains( object extension ); [C++] public: bool Contains( Object* extension ); [JScript] public function Contains( extension : Object ) : Boolean;
Parameters
- extension
- The ServiceDescriptionFormatExtension for which to check collection membership.
Return Value
true if the extension parameter is a member of the collection; otherwise, false.
Example
[Visual Basic] ' 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 [C#] // 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."); } [C++] // Check for 'myFormatExtension' object in collection. if (myCollection->Contains(myFormatExtensionObject)) { // Get index of a 'myFormatExtension' object in collection. Console::WriteLine(S"Index of 'myFormatExtensionObject' is {0} in collection.", __box(myCollection->IndexOf(myFormatExtensionObject))); // Remove 'myFormatExtensionObject' element from collection. myCollection->Remove(myFormatExtensionObject); Console::WriteLine(S"'myFormatExtensionObject' is removed from collection."); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also
ServiceDescriptionFormatExtensionCollection Class | ServiceDescriptionFormatExtensionCollection Members | System.Web.Services.Description Namespace
Show: