ServiceDescriptionCollection Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Representerar en samling instanser av ServiceDescription klassen. Det går inte att ärva den här klassen.
public ref class ServiceDescriptionCollection sealed : System::Web::Services::Description::ServiceDescriptionBaseCollection
public sealed class ServiceDescriptionCollection : System.Web.Services.Description.ServiceDescriptionBaseCollection
type ServiceDescriptionCollection = class
inherit ServiceDescriptionBaseCollection
Public NotInheritable Class ServiceDescriptionCollection
Inherits ServiceDescriptionBaseCollection
- Arv
Exempel
#using <System.Web.Services.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::Xml;
using namespace System::Web::Services::Description;
int main()
{
try
{
// Get ServiceDescription objects.
ServiceDescription^ myServiceDescription1 = ServiceDescription::Read( "DataTypes_cpp.wsdl" );
ServiceDescription^ myServiceDescription2 = ServiceDescription::Read( "MathService_cpp.wsdl" );
// Set the names of the ServiceDescriptions.
myServiceDescription1->Name = "DataTypes";
myServiceDescription2->Name = "MathService";
// Create a ServiceDescriptionCollection.
ServiceDescriptionCollection^ myServiceDescriptionCollection = gcnew ServiceDescriptionCollection;
// Add the ServiceDescriptions to the collection.
myServiceDescriptionCollection->Add( myServiceDescription1 );
myServiceDescriptionCollection->Add( myServiceDescription2 );
// Display the elements of the collection using the Item property.
Console::WriteLine( "Elements in the collection: " );
for ( int i = 0; i < myServiceDescriptionCollection->Count; i++ )
Console::WriteLine( myServiceDescriptionCollection[ i ]->Name );
// Construct an XML qualified name.
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "MathServiceSoap","http://tempuri2.org/" );
// Get the Binding from the collection.
Binding^ myBinding = myServiceDescriptionCollection->GetBinding( myXmlQualifiedName );
Console::WriteLine( "Binding found in collection with name: {0}", myBinding->ServiceDescription->Name );
}
catch ( Exception^ e )
{
Console::WriteLine( "The following exception was raised: {0}", e->Message );
}
}
using System;
using System.Xml;
using System.Web.Services.Description;
class MyServiceDescriptionCollection
{
public static void Main()
{
try
{
// Get ServiceDescription objects.
ServiceDescription myServiceDescription1 =
ServiceDescription.Read("DataTypes_CS.wsdl");
ServiceDescription myServiceDescription2 =
ServiceDescription.Read("MathService_CS.wsdl");
// Set the names of the ServiceDescriptions.
myServiceDescription1.Name = "DataTypes";
myServiceDescription2.Name = "MathService";
// Create a ServiceDescriptionCollection.
ServiceDescriptionCollection myServiceDescriptionCollection =
new ServiceDescriptionCollection();
// Add the ServiceDescriptions to the collection.
myServiceDescriptionCollection.Add(myServiceDescription1);
myServiceDescriptionCollection.Add(myServiceDescription2);
// Display the elements of the collection using the indexer.
Console.WriteLine("Elements in the collection: ");
for(int i = 0; i < myServiceDescriptionCollection.Count; i++)
{
Console.WriteLine(myServiceDescriptionCollection[i].Name);
}
// Construct an XML qualified name.
XmlQualifiedName myXmlQualifiedName =
new XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/");
// Get the Binding from the collection.
Binding myBinding =
myServiceDescriptionCollection.GetBinding(myXmlQualifiedName);
Console.WriteLine("Binding found in collection with name: " +
myBinding.ServiceDescription.Name);
}
catch(Exception e)
{
Console.WriteLine("The following exception was raised: {0}", e.Message);
}
}
}
Imports System.Xml
Imports System.Web.Services.Description
Class MyServiceDescriptionCollection
Public Shared Sub Main()
Try
' Get ServiceDescription objects.
Dim myServiceDescription1 As ServiceDescription = _
ServiceDescription.Read("DataTypes_VB.wsdl")
Dim myServiceDescription2 As ServiceDescription = _
ServiceDescription.Read("MathService_VB.wsdl")
' Set the names of the ServiceDescriptions.
myServiceDescription1.Name = "DataTypes"
myServiceDescription2.Name = "MathService"
' Create a ServiceDescriptionCollection.
Dim myServiceDescriptionCollection As _
New ServiceDescriptionCollection()
' Add the ServiceDescriptions to the collection.
myServiceDescriptionCollection.Add(myServiceDescription1)
myServiceDescriptionCollection.Add(myServiceDescription2)
' Display the elements of the collection using the Item property.
Console.WriteLine("Elements in the collection: ")
Dim i As Integer
For i = 0 To myServiceDescriptionCollection.Count - 1
Console.WriteLine(myServiceDescriptionCollection(i).Name)
Next i
' Construct an XML qualified name.
Dim myXmlQualifiedName As New XmlQualifiedName( _
"MathServiceSoap", "http://tempuri2.org/")
' Get the Binding from the collection.
Dim myBinding As Binding = _
myServiceDescriptionCollection.GetBinding(myXmlQualifiedName)
Console.WriteLine("Binding found in collection with name: " & _
myBinding.ServiceDescription.Name)
Catch e As Exception
Console.WriteLine("The following exception was raised: {0}", _
e.Message.ToString())
End Try
End Sub
End Class
Konstruktorer
| Name | Description |
|---|---|
| ServiceDescriptionCollection() |
Initierar en ny instans av ServiceDescriptionCollection klassen. |
Egenskaper
| Name | Description |
|---|---|
| Capacity |
Hämtar eller anger antalet element som CollectionBase kan innehålla. (Ärvd från CollectionBase) |
| Count |
Hämtar antalet element som finns i instansen CollectionBase . Den här egenskapen kan inte åsidosättas. (Ärvd från CollectionBase) |
| InnerList |
Hämtar en ArrayList lista med element i instansen CollectionBase . (Ärvd från CollectionBase) |
| Item[Int32] |
Hämtar eller anger värdet för ett ServiceDescription vid det angivna nollbaserade indexet. |
| Item[String] |
Hämtar en ServiceDescription angiven av dess TargetNamespace egenskap. |
| List |
Hämtar en IList lista med element i instansen CollectionBase . (Ärvd från CollectionBase) |
| Table |
Hämtar ett gränssnitt som implementerar associationen mellan nycklar och värden i ServiceDescriptionBaseCollection. (Ärvd från ServiceDescriptionBaseCollection) |
Metoder
| Name | Description |
|---|---|
| Add(ServiceDescription) |
Lägger till den angivna ServiceDescription i slutet av ServiceDescriptionCollection. |
| Clear() |
Tar bort alla objekt från instansen CollectionBase . Den här metoden kan inte åsidosättas. (Ärvd från CollectionBase) |
| Contains(ServiceDescription) |
Returnerar ett värde som anger om den angivna ServiceDescription är medlem i samlingen. |
| CopyTo(ServiceDescription[], Int32) |
Kopierar hela ServiceDescriptionCollection till en endimensionell matris av typen ServiceDescription, med början vid det angivna nollbaserade indexet för målmatrisen. |
| Equals(Object) |
Avgör om det angivna objektet är lika med det aktuella objektet. (Ärvd från Object) |
| GetBinding(XmlQualifiedName) |
Söker i ServiceDescriptionCollection och returnerar Binding med det angivna namnet som är medlem i en av instanserna ServiceDescription i samlingen. |
| GetEnumerator() |
Returnerar en uppräkning som itererar genom instansen CollectionBase . (Ärvd från CollectionBase) |
| GetHashCode() |
Fungerar som standard-hash-funktion. (Ärvd från Object) |
| GetKey(Object) |
Returnerar namnet på nyckeln som är associerad med värdet som skickas av referensen. (Ärvd från ServiceDescriptionBaseCollection) |
| GetMessage(XmlQualifiedName) |
Söker i ServiceDescriptionCollection och returnerar Message med det angivna namnet som är medlem i en av instanserna ServiceDescription i samlingen. |
| GetPortType(XmlQualifiedName) |
Söker i ServiceDescriptionCollection och returnerar PortType med det angivna namnet som är medlem i en av instanserna ServiceDescription i samlingen. |
| GetService(XmlQualifiedName) |
Söker i ServiceDescriptionCollection och returnerar Service med det angivna namnet som är medlem i en av instanserna ServiceDescription i samlingen. |
| GetType() |
Hämtar den aktuella instansen Type . (Ärvd från Object) |
| IndexOf(ServiceDescription) |
Söker efter det angivna ServiceDescription och returnerar det nollbaserade indexet för den första förekomsten i samlingen. |
| Insert(Int32, ServiceDescription) |
Lägger till den angivna ServiceDescription instansen ServiceDescriptionCollection i det angivna nollbaserade indexet. |
| MemberwiseClone() |
Skapar en ytlig kopia av den aktuella Object. (Ärvd från Object) |
| OnClear() |
Rensar innehållet i instansen ServiceDescriptionBaseCollection . (Ärvd från ServiceDescriptionBaseCollection) |
| OnClearComplete() |
Utför ytterligare anpassade processer när innehållet i instansen har rensats CollectionBase . (Ärvd från CollectionBase) |
| OnInsert(Int32, Object) |
Utför ytterligare anpassade processer innan du infogar ett nytt element i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnInsertComplete(Int32, Object) |
Utför ytterligare anpassade processer när du har infogat ett nytt element i ServiceDescriptionBaseCollection. (Ärvd från ServiceDescriptionBaseCollection) |
| OnRemove(Int32, Object) |
Tar bort ett element från ServiceDescriptionBaseCollection. (Ärvd från ServiceDescriptionBaseCollection) |
| OnRemoveComplete(Int32, Object) |
Utför ytterligare anpassade processer när du har tagit bort ett element från instansen CollectionBase . (Ärvd från CollectionBase) |
| OnSet(Int32, Object, Object) |
Ersätter ett värde med ett annat i ServiceDescriptionBaseCollection. (Ärvd från ServiceDescriptionBaseCollection) |
| OnSetComplete(Int32, Object, Object) |
Utför ytterligare anpassade processer när du har angett ett värde i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnValidate(Object) |
Utför ytterligare anpassade processer när du verifierar ett värde. (Ärvd från CollectionBase) |
| Remove(ServiceDescription) |
Tar bort den första förekomsten av den angivna ServiceDescription från samlingen. |
| RemoveAt(Int32) |
Tar bort elementet vid det angivna indexet för instansen CollectionBase . Den här metoden kan inte åsidosättas. (Ärvd från CollectionBase) |
| SetParent(Object, Object) |
Anger instansens ServiceDescriptionBaseCollection överordnade objekt. (Ärvd från ServiceDescriptionBaseCollection) |
| ToString() |
Returnerar en sträng som representerar det aktuella objektet. (Ärvd från Object) |
Explicita gränssnittsimplementeringar
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Kopierar hela CollectionBase till en kompatibel endimensionell Array, med början vid det angivna indexet för målmatrisen. (Ärvd från CollectionBase) |
| ICollection.IsSynchronized |
Hämtar ett värde som anger om åtkomsten CollectionBase till är synkroniserad (trådsäker). (Ärvd från CollectionBase) |
| ICollection.SyncRoot |
Hämtar ett objekt som kan användas för att synkronisera åtkomsten CollectionBasetill . (Ärvd från CollectionBase) |
| IList.Add(Object) |
Lägger till ett objekt i slutet av CollectionBase. (Ärvd från CollectionBase) |
| IList.Contains(Object) |
Avgör om innehåller CollectionBase ett specifikt element. (Ärvd från CollectionBase) |
| IList.IndexOf(Object) |
Söker efter den angivna Object och returnerar det nollbaserade indexet för den första förekomsten i hela CollectionBase. (Ärvd från CollectionBase) |
| IList.Insert(Int32, Object) |
Infogar ett element i CollectionBase det angivna indexet. (Ärvd från CollectionBase) |
| IList.IsFixedSize |
Hämtar ett värde som anger om har CollectionBase en fast storlek. (Ärvd från CollectionBase) |
| IList.IsReadOnly |
Hämtar ett värde som anger om är CollectionBase skrivskyddat. (Ärvd från CollectionBase) |
| IList.Item[Int32] |
Hämtar eller anger elementet vid det angivna indexet. (Ärvd från CollectionBase) |
| IList.Remove(Object) |
Tar bort den första förekomsten av ett specifikt objekt från CollectionBase. (Ärvd från CollectionBase) |
Tilläggsmetoder
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Möjliggör parallellisering av en fråga. |
| AsQueryable(IEnumerable) |
Konverterar en IEnumerable till en IQueryable. |
| Cast<TResult>(IEnumerable) |
Omvandlar elementen i en IEnumerable till den angivna typen. |
| OfType<TResult>(IEnumerable) |
Filtrerar elementen i en IEnumerable baserat på en angiven typ. |