Aracılığıyla paylaş


DiscoveryClientDocumentCollection.Add(String, Object) Yöntem

Tanım

öğesine belirtilen URL'ye DiscoveryClientDocumentCollectionsahip bir nesne ekler.

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)

Parametreler

url
String

Belgeye eklenecek belgenin URL'si DiscoveryClientDocumentCollection.

value
Object

öğesine eklenecek DiscoveryClientDocumentCollectionbulunan bir belge.

Özel durumlar

url, null değeridir.

anahtarına url sahip bir giriş içinde DiscoveryClientDocumentCollectionzaten var.

Örnekler

Aşağıdaki kod örneği bir DiscoveryClientDocumentCollectionöğesine iki bulma belgesi ekler.

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)

Şunlara uygulanır

Ayrıca bkz.