CodeNamespaceImportCollection 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示 CodeNamespaceImport 物件的集合。
public ref class CodeNamespaceImportCollection : System::Collections::IList
public class CodeNamespaceImportCollection : System.Collections.IList
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeNamespaceImportCollection : System.Collections.IList
type CodeNamespaceImportCollection = class
interface ICollection
interface IEnumerable
interface IList
type CodeNamespaceImportCollection = class
interface IList
interface ICollection
interface IEnumerable
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeNamespaceImportCollection = class
interface IList
interface ICollection
interface IEnumerable
Public Class CodeNamespaceImportCollection
Implements IList
- 繼承
-
CodeNamespaceImportCollection
- 屬性
- 實作
下列範例示範 類別的 CodeNamespaceImportCollection 一些成員。 此範例會初始化 類別的新實例、將物件加入 CodeNamespaceImport 其中,並取得集合中的物件總數。
// Creates an empty CodeNamespaceImportCollection.
CodeNamespaceImportCollection^ collection =
gcnew CodeNamespaceImportCollection;
// Adds a CodeNamespaceImport to the collection.
collection->Add( gcnew CodeNamespaceImport( "System" ) );
// Adds an array of CodeNamespaceImport objects to the collection.
array<CodeNamespaceImport^>^ Imports = {
gcnew CodeNamespaceImport( "System" ),
gcnew CodeNamespaceImport( "System.Drawing" )};
collection->AddRange( Imports );
// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;
// Creates an empty CodeNamespaceImportCollection.
CodeNamespaceImportCollection collection =
new CodeNamespaceImportCollection();
// Adds a CodeNamespaceImport to the collection.
collection.Add( new CodeNamespaceImport("System") );
// Adds an array of CodeNamespaceImport objects to the collection.
CodeNamespaceImport[] Imports = {
new CodeNamespaceImport("System"),
new CodeNamespaceImport("System.Drawing") };
collection.AddRange( Imports );
// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;
' Creates an empty CodeNamespaceImportCollection.
Dim collection As New CodeNamespaceImportCollection()
' Adds a CodeNamespaceImport to the collection.
collection.Add(New CodeNamespaceImport("System"))
' Adds an array of CodeNamespaceImport objects to the collection.
Dim [Imports] As CodeNamespaceImport() = _
{New CodeNamespaceImport("System"), _
New CodeNamespaceImport("System.Drawing")}
collection.AddRange([Imports])
' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count
CodeNamespaceImportCollection 類別提供可用來儲存一組 CodeNamespaceImport 物件的簡單集合物件。
Code |
初始化 CodeNamespaceImportCollection 類別的新執行個體。 |
Count |
取得集合中的命名空間 (Namespace) 數目。 |
Item[Int32] |
取得或設定位於集合中所指定索引處的 CodeNamespaceImport 物件。 |
Add(Code |
將 CodeNamespaceImport 物件加入至集合。 |
Add |
將一組 CodeNamespaceImport 物件加入至集合中。 |
Clear() |
清除成員的集合。 |
Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
Get |
取得列舉集合成員的列舉值。 |
Get |
做為預設雜湊函式。 (繼承來源 Object) |
Get |
取得目前執行個體的 Type。 (繼承來源 Object) |
Memberwise |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
To |
傳回代表目前物件的字串。 (繼承來源 Object) |
ICollection. |
從特定的 ICollection 索引開始,將 Array 的項目複製到 Array。 |
ICollection. |
取得 ICollection 中所包含的項目數。 |
ICollection. |
取得值,這個值表示對 ICollection 的存取是否同步 (安全執行緒)。 |
ICollection. |
取得可用以同步存取 ICollection 的物件。 |
IEnumerable. |
傳回可逐一查看集合的列舉值。 |
IList. |
將物件加入 IList。 |
IList. |
從 IList 中移除所有項目。 |
IList. |
判斷 IList 是否包含特定值。 |
IList. |
判斷 IList 中指定項目的索引。 |
IList. |
將項目插入位於指定位置的 IList。 |
IList. |
取得值,指出 IList 是否有固定的大小。 |
IList. |
取得值,指出 IList 是否唯讀。 |
IList. |
在指定的索引位置上取得或設定項目。 |
IList. |
從 IList 移除特定物件之第一個符合的元素。 |
IList. |
移除 IList 之指定索引處的項目。 |
Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
Of |
根據指定的型別來篩選 IEnumerable 的項目。 |
As |
啟用查詢的平行化作業。 |
As |
將 IEnumerable 轉換成 IQueryable。 |
產品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |