Compartilhar via


DiscoveryClientDocumentCollection.Remove(String) Método

Definição

Remove um objeto com a URL especificada da DiscoveryClientDocumentCollection.

public:
 void Remove(System::String ^ url);
public void Remove (string url);
member this.Remove : string -> unit
Public Sub Remove (url As String)

Parâmetros

url
String

A URL para o documento de descoberta a ser removido da DiscoveryClientDocumentCollection.

Exceções

url é null.

Exemplos

O exemplo de código a seguir remove o documento de http://www.contoso.com/service1.disco descoberta com uma URL do DiscoveryClientDocumentCollection.

DiscoveryClientDocumentCollection^ myDiscoveryClientDocumentCollection = gcnew DiscoveryClientDocumentCollection;

DiscoveryDocument^ myDiscoveryDocument = gcnew DiscoveryDocument;
String^ myStringUrl = "http://www.contoso.com/service.disco";
String^ myStringUrl1 = "http://www.contoso.com/service1.disco";
myDiscoveryClientDocumentCollection->Add( myStringUrl, myDiscoveryDocument );
myDiscoveryClientDocumentCollection->Add( myStringUrl1, myDiscoveryDocument );

myDiscoveryClientDocumentCollection->Remove( myStringUrl1 );
DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection =
   new DiscoveryClientDocumentCollection();
DiscoveryDocument myDiscoveryDocument = new DiscoveryDocument();
string myStringUrl = "http://www.contoso.com/service.disco";
string myStringUrl1 = "http://www.contoso.com/service1.disco";

myDiscoveryClientDocumentCollection.Add(myStringUrl, myDiscoveryDocument);
myDiscoveryClientDocumentCollection.Add(myStringUrl1, myDiscoveryDocument);
myDiscoveryClientDocumentCollection.Remove(myStringUrl1);
Dim myDiscoveryClientDocumentCollection As New DiscoveryClientDocumentCollection()
Dim myDiscoveryDocument As New DiscoveryDocument()
Dim myStringUrl As String = "http://www.contoso.com/service.disco"
Dim myStringUrl1 As String = "http://www.contoso.com/service1.disco"

myDiscoveryClientDocumentCollection.Add(myStringUrl, myDiscoveryDocument)
myDiscoveryClientDocumentCollection.Add(myStringUrl1, myDiscoveryDocument)
myDiscoveryClientDocumentCollection.Remove(myStringUrl1)

Aplica-se a

Confira também