PortTypeCollection.Contains メソッド
アセンブリ: System.Web.Services (system.web.services.dll 内)

Dim instance As PortTypeCollection Dim portType As PortType Dim returnValue As Boolean returnValue = instance.Contains(portType)
戻り値
portType パラメータが PortTypeCollection のメンバである場合は true。それ以外の場合は false。

Dim myServiceDescription As ServiceDescription = _ ServiceDescription.Read("MathService_VB.wsdl") Dim myPortTypeCollection As PortTypeCollection = _ myServiceDescription.PortTypes Dim noOfPortTypes As Integer = myServiceDescription.PortTypes.Count Console.WriteLine(ControlChars.Newline & _ "Total number of PortTypes: " & noOfPortTypes.ToString()) Dim myNewPortType As PortType = myPortTypeCollection("MathServiceSoap") ' Get the index in the collection. Dim index As Integer = myPortTypeCollection.IndexOf(myNewPortType) Console.WriteLine("Removing the PortType named " & _ myNewPortType.Name) ' Remove the PortType from the collection. myPortTypeCollection.Remove(myNewPortType) noOfPortTypes = myServiceDescription.PortTypes.Count Console.WriteLine(ControlChars.Newline & _ "Total number of PortTypes: " & noOfPortTypes.ToString()) ' Check whether the PortType exists in the collection. Dim bContains As Boolean = myPortTypeCollection.Contains(myNewPortType) Console.WriteLine("Port Type'" & myNewPortType.Name & _ "' exists: " & bContains.ToString()) Console.WriteLine("Adding the 'PortType'") ' Insert a new portType at the index location. myPortTypeCollection.Insert(index, myNewPortType) ' Display the number of portTypes after adding a port. Console.WriteLine("Total number of PortTypes after " & _ "adding a new port: " & _ myServiceDescription.PortTypes.Count.ToString()) bContains = myPortTypeCollection.Contains(myNewPortType) Console.WriteLine("Port Type'" & myNewPortType.Name & "' exists: " _ & bContains.ToString()) myServiceDescription.Write("MathService_New.wsdl")
ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_CS.wsdl"); PortTypeCollection myPortTypeCollection = myServiceDescription.PortTypes; int noOfPortTypes = myServiceDescription.PortTypes.Count; Console.WriteLine("\nTotal number of PortTypes: " + noOfPortTypes); PortType myNewPortType = myPortTypeCollection["MathServiceSoap"]; // Get the index in the collection. int index = myPortTypeCollection.IndexOf(myNewPortType); Console.WriteLine("Removing the PortType named " + myNewPortType.Name); // Remove the PortType from the collection. myPortTypeCollection.Remove(myNewPortType); noOfPortTypes = myServiceDescription.PortTypes.Count; Console.WriteLine("\nTotal number of PortTypes: " + noOfPortTypes); // Check whether the PortType exists in the collection. bool bContains = myPortTypeCollection.Contains(myNewPortType); Console.WriteLine("Port Type'" + myNewPortType.Name + "' exists: " + bContains ); Console.WriteLine("Adding the PortType"); // Insert a new portType at the index location. myPortTypeCollection.Insert(index, myNewPortType); // Display the number of portTypes after adding a port. Console.WriteLine("Total number of PortTypes after " + "adding a new port: " + myServiceDescription.PortTypes.Count); bContains = myPortTypeCollection.Contains(myNewPortType); Console.WriteLine("Port Type'" + myNewPortType.Name + "' exists: " + bContains ); myServiceDescription.Write("MathService_New.wsdl");
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); PortTypeCollection^ myPortTypeCollection = myServiceDescription->PortTypes; int noOfPortTypes = myServiceDescription->PortTypes->Count; Console::WriteLine( "\nTotal number of PortTypes: {0}", noOfPortTypes ); PortType^ myNewPortType = myPortTypeCollection[ "MathServiceSoap" ]; // Get the index in the collection. int index = myPortTypeCollection->IndexOf( myNewPortType ); Console::WriteLine( "Removing the PortType named {0}", myNewPortType->Name ); // Remove the PortType from the collection. myPortTypeCollection->Remove( myNewPortType ); noOfPortTypes = myServiceDescription->PortTypes->Count; Console::WriteLine( "\nTotal number of PortTypes: {0}", noOfPortTypes ); // Check whether the PortType exists in the collection. bool bContains = myPortTypeCollection->Contains( myNewPortType ); Console::WriteLine( "Port Type'{0}' exists: {1}", myNewPortType->Name, bContains ); Console::WriteLine( "Adding the PortType" ); // Insert a new portType at the index location. myPortTypeCollection->Insert( index, myNewPortType ); // Display the number of portTypes after adding a port. Console::WriteLine( "Total number of PortTypes after adding a new port: {0}", myServiceDescription->PortTypes->Count ); bContains = myPortTypeCollection->Contains( myNewPortType ); Console::WriteLine( "Port Type'{0}' exists: {1}", myNewPortType->Name, bContains ); myServiceDescription->Write( "MathService_New.wsdl" );
ServiceDescription myServiceDescription = ServiceDescription.Read( "MathService_JSL.wsdl"); PortTypeCollection myPortTypeCollection = myServiceDescription.get_PortTypes(); int noOfPortTypes = myServiceDescription.get_PortTypes().get_Count(); Console.WriteLine("\nTotal number of PortTypes: " + noOfPortTypes); PortType myNewPortType = myPortTypeCollection.get_Item("MathServiceSoap"); // Get the index in the collection. int index = myPortTypeCollection.IndexOf(myNewPortType); Console.WriteLine("Removing the PortType named " + myNewPortType.get_Name()); // Remove the PortType from the collection. myPortTypeCollection.Remove(myNewPortType); noOfPortTypes = myServiceDescription.get_PortTypes().get_Count(); Console.WriteLine("\nTotal number of PortTypes: " + noOfPortTypes); // Check whether the PortType exists in the collection. boolean bContains = myPortTypeCollection.Contains(myNewPortType); Console.WriteLine("Port Type'" + myNewPortType.get_Name() + "' exists: " + bContains); Console.WriteLine("Adding the PortType"); // Insert a new portType at the index location. myPortTypeCollection.Insert(index, myNewPortType); // Display the number of portTypes after adding a port. Console.WriteLine("Total number of PortTypes after " + "adding a new port: " + myServiceDescription.get_PortTypes().get_Count()); bContains = myPortTypeCollection.Contains(myNewPortType); Console.WriteLine("Port Type'" + myNewPortType.get_Name() + "' exists: " + bContains); myServiceDescription.Write("MathService_New.wsdl");

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からPortTypeCollection.Contains メソッドを検索する場合は、下記のリンクをクリックしてください。

- PortTypeCollection.Contains メソッドのページへのリンク