다음을 통해 공유


PortCollection.Contains(Port) 메서드

정의

지정된 PortPortCollection의 멤버인지 여부를 나타내는 값을 반환합니다.

public:
 bool Contains(System::Web::Services::Description::Port ^ port);
public bool Contains (System.Web.Services.Description.Port port);
member this.Contains : System.Web.Services.Description.Port -> bool
Public Function Contains (port As Port) As Boolean

매개 변수

port
Port

컬렉션 멤버인지 확인할 Port입니다.

반환

Boolean

지정된 PortPortCollection의 멤버이면 true이고, 그렇지 않으면 false입니다.

예제

myPortCollection = myService->Ports;
Port^ myNewPort = myPortCollection[ 0 ];
myPortCollection->Remove( myNewPort );

// Display the number of ports.
Console::WriteLine( "\nTotal number of ports before adding a new port : {0}", myService->Ports->Count );

// Add a new port.
myPortCollection->Add( myNewPort );

// Display the number of ports after adding a port.
Console::WriteLine( "Total number of ports after adding a new port : {0}", myService->Ports->Count );

myPortCollection = myService.Ports;
Port myNewPort = myPortCollection[0];

myPortCollection.Remove(myNewPort);

// Display the number of ports.
Console.WriteLine("\nTotal number of ports before"
   + " adding a new port : " +  myService.Ports.Count);

// Add a new port.
myPortCollection.Add(myNewPort);

// Display the number of ports after adding a port.
Console.WriteLine("Total number of ports after"
   + " adding a new port : " + myService.Ports.Count);
myPortCollection = myService.Ports
Dim myNewPort As Port = myPortCollection(0)
myPortCollection.Remove(myNewPort)

' Display the number of ports.
Console.WriteLine(ControlChars.NewLine & _
   "Total number of ports before " & _
   "adding a new port : " & _
   myService.Ports.Count.ToString)

' Add a new port.
myPortCollection.Add(myNewPort)

' Display the number of ports after adding a port.
Console.WriteLine("Total number of ports after " & _
   "adding a new port : " & _
   myService.Ports.Count.ToString)

적용 대상