CodeNamespaceImportCollection 类   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示 CodeNamespaceImport 对象集合。
public ref class CodeNamespaceImportCollection : System::Collections::IListpublic 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.IListtype CodeNamespaceImportCollection = class
    interface ICollection
    interface IEnumerable
    interface IListtype 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 IEnumerablePublic 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 对象。
构造函数
| CodeNamespaceImportCollection() | 初始化 CodeNamespaceImportCollection 类的新实例。 | 
属性
| Count | 获取集合中命名空间的数目。 | 
| Item[Int32] | 获取或设置集合中指定索引处的 CodeNamespaceImport 对象。 | 
方法
| Add(CodeNamespaceImport) | 将 CodeNamespaceImport 对象添加到集合中。 | 
| AddRange(CodeNamespaceImport[]) | 向集合添加一组 CodeNamespaceImport 对象。 | 
| Clear() | 清除成员集合。 | 
| Equals(Object) | 确定指定对象是否等于当前对象。(继承自 Object) | 
| GetEnumerator() | 获取枚举集合成员的枚举数。 | 
| GetHashCode() | 作为默认哈希函数。(继承自 Object) | 
| GetType() | 获取当前实例的 Type。(继承自 Object) | 
| MemberwiseClone() | 创建当前 Object 的浅表副本。(继承自 Object) | 
| ToString() | 返回表示当前对象的字符串。(继承自 Object) | 
显式接口实现
| ICollection.CopyTo(Array, Int32) | 从特定的 ICollection 索引开始,将 Array 的元素复制到一个 Array 中。 | 
| ICollection.Count | 获取 ICollection 中包含的元素数。 | 
| ICollection.IsSynchronized | 获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。 | 
| ICollection.SyncRoot | 获取可用于同步对 ICollection 的访问的对象。 | 
| IEnumerable.GetEnumerator() | 返回可循环访问集合的枚举数。 | 
| IList.Add(Object) | 将对象添加到 IList 中。 | 
| IList.Clear() | 从 IList 中移除所有项。 | 
| IList.Contains(Object) | 确定 IList 是否包含特定值。 | 
| IList.IndexOf(Object) | 确定 IList 中特定项的索引。 | 
| IList.Insert(Int32, Object) | 在 IList 中的指定位置插入项。 | 
| IList.IsFixedSize | 获取一个值,该值指示 IList 是否具有固定大小。 | 
| IList.IsReadOnly | 获取一个值,该值指示 IList 是否为只读。 | 
| IList.Item[Int32] | 获取或设置指定索引处的元素。 | 
| IList.Remove(Object) | 从 IList 中移除特定对象的第一个匹配项。 | 
| IList.RemoveAt(Int32) | 移除 IList 的指定索引处的元素。 | 
扩展方法
| Cast<TResult>(IEnumerable) | 将 IEnumerable 的元素强制转换为指定的类型。 | 
| OfType<TResult>(IEnumerable) | 根据指定类型筛选 IEnumerable 的元素。 | 
| AsParallel(IEnumerable) | 启用查询的并行化。 | 
| AsQueryable(IEnumerable) | 将 IEnumerable 转换为 IQueryable。 |