ServiceDescriptionCollection.Remove(ServiceDescription) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
移除該集合 ServiceDescription 中指定的首次出現。
public:
void Remove(System::Web::Services::Description::ServiceDescription ^ serviceDescription);
public void Remove(System.Web.Services.Description.ServiceDescription serviceDescription);
member this.Remove : System.Web.Services.Description.ServiceDescription -> unit
Public Sub Remove (serviceDescription As ServiceDescription)
參數
- serviceDescription
- ServiceDescription
從收藏中移除。ServiceDescription
範例
// Get the index of 'ServiceDescription' object.
int myIndex = myCollection.IndexOf(myServiceDescription2);
// Remove 'ServiceDescription' object from the collection.
myCollection.Remove(myServiceDescription2);
Console.WriteLine("Element at index {0} is removed ", myIndex);
' Get the index of 'ServiceDescription' object.
Dim myIndex As Integer = myCollection.IndexOf(myServiceDescription2)
' Remove 'ServiceDescription' object from the collection.
myCollection.Remove(myServiceDescription2)
Console.WriteLine("Element at index {0} is removed ", myIndex.ToString())
備註
此方法執行線性搜尋;因此,平均執行時間與 Count成正比。
跟隨移除 ServiceDescription 的元素會往上移動,佔據空出的位置。