ReadOnlyCollection<T>.ICollection<T>.Add(T) ReadOnlyCollection<T>.ICollection<T>.Add(T) ReadOnlyCollection<T>.ICollection<T>.Add(T) Method

定義

將項目加入至 ICollection<T>Adds an item to the ICollection<T>. 這個實作一律會擲回 NotSupportedExceptionThis implementation always throws NotSupportedException.

 virtual void System.Collections.Generic.ICollection<T>.Add(T value) = System::Collections::Generic::ICollection<T>::Add;
void ICollection<T>.Add (T value);
Sub Add (value As T) Implements ICollection(Of T).Add

參數

value
T T T

要加入至 ICollection<T> 的物件。The object to add to the ICollection<T>.

實作

例外狀況

備註

這個成員是明確介面成員實作,This member is an explicit interface member implementation. 只有在 ReadOnlyCollection<T> 執行個體轉換成 ICollection<T> 介面時,才能使用這個成員。It can be used only when the ReadOnlyCollection<T> instance is cast to an ICollection<T> interface.

適用於