Udostępnij za pośrednictwem


DiscoveryClientDocumentCollection.Add(String, Object) Metoda

Definicja

Dodaje obiekt o określonym adresie URL do obiektu DiscoveryClientDocumentCollection.

public:
 void Add(System::String ^ url, System::Object ^ value);
public void Add (string url, object value);
member this.Add : string * obj -> unit
Public Sub Add (url As String, value As Object)

Parametry

url
String

Adres URL dokumentu do dodania do elementu DiscoveryClientDocumentCollection.

value
Object

Odnaleziony dokument do dodania do elementu DiscoveryClientDocumentCollection.

Wyjątki

url to null.

Wpis o kluczu url już istnieje w pliku DiscoveryClientDocumentCollection.

Przykłady

Poniższy przykład kodu dodaje dwa dokumenty odnajdywania do elementu 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 );
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);
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)

Dotyczy

Zobacz też