CodeNamespaceCollection クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CodeNamespaceCollection クラスの意味・解説 

CodeNamespaceCollection クラス

CodeNamespace オブジェクトコレクション表します

名前空間: System.CodeDom
アセンブリ: System (system.dll 内)
構文構文

<SerializableAttribute> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class CodeNamespaceCollection
    Inherits CollectionBase
Dim instance As CodeNamespaceCollection
[SerializableAttribute] 
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
[ComVisibleAttribute(true)] 
public class CodeNamespaceCollection : CollectionBase
[SerializableAttribute] 
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
[ComVisibleAttribute(true)] 
public ref class CodeNamespaceCollection :
 public CollectionBase
/** @attribute SerializableAttribute() */ 
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
/** @attribute ComVisibleAttribute(true) */ 
public class CodeNamespaceCollection extends
 CollectionBase
SerializableAttribute 
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
ComVisibleAttribute(true) 
public class CodeNamespaceCollection extends
 CollectionBase
解説解説
使用例使用例
' Creates an empty CodeNamespaceCollection.            
Dim collection As New CodeNamespaceCollection()

' Adds a CodeNamespace to the collection.
collection.Add(New CodeNamespace("TestNamespace"))

' Adds an array of CodeNamespace objects to the collection.
Dim namespaces As CodeNamespace() = {New CodeNamespace("TestNamespace1"),
 New CodeNamespace("TestNamespace2")}
collection.AddRange(namespaces)

' Adds a collection of CodeNamespace objects to the collection.
Dim namespacesCollection As New
 CodeNamespaceCollection()
namespacesCollection.Add(New CodeNamespace("TestNamespace1"))
namespacesCollection.Add(New CodeNamespace("TestNamespace2"))
collection.AddRange(namespacesCollection)

' Tests for the presence of a CodeNamespace in the collection,
' and retrieves its index if it is found.
Dim testNamespace As New
 CodeNamespace("TestNamespace")
Dim itemIndex As Integer
 = -1
If collection.Contains(testNamespace) Then
    itemIndex = collection.IndexOf(testNamespace)
End If

' Copies the contents of the collection beginning at index 0,
' to the specified CodeNamespace array.
' 'namespaces' is a CodeNamespace array.
collection.CopyTo(namespaces, 0)

' Retrieves the count of the items in the collection.
Dim collectionCount As Integer
 = collection.Count

' Inserts a CodeNamespace at index 0 of the collection.
collection.Insert(0, New CodeNamespace("TestNamespace"))

' Removes the specified CodeNamespace from the collection.
Dim namespace_ As New CodeNamespace("TestNamespace")
collection.Remove(namespace_)

' Removes the CodeNamespace at index 0.
collection.RemoveAt(0)
// Creates an empty CodeNamespaceCollection.            
CodeNamespaceCollection collection = new CodeNamespaceCollection();

// Adds a CodeNamespace to the collection.
collection.Add( new CodeNamespace("TestNamespace") );

// Adds an array of CodeNamespace objects to the collection.
CodeNamespace[] namespaces = { new CodeNamespace("TestNamespace1"),
 new CodeNamespace("TestNamespace2") };
collection.AddRange( namespaces );

// Adds a collection of CodeNamespace objects to the collection.
CodeNamespaceCollection namespacesCollection = new CodeNamespaceCollection();
namespacesCollection.Add( new CodeNamespace("TestNamespace1")
 );
namespacesCollection.Add( new CodeNamespace("TestNamespace2")
 );
collection.AddRange( namespacesCollection );

// Tests for the presence of a CodeNamespace in the collection,
// and retrieves its index if it is found.
CodeNamespace testNamespace = new CodeNamespace("TestNamespace");
int itemIndex = -1;
if( collection.Contains( testNamespace ) )
    itemIndex = collection.IndexOf( testNamespace );

// Copies the contents of the collection beginning at index 0,
// to the specified CodeNamespace array.
// 'namespaces' is a CodeNamespace array.
collection.CopyTo( namespaces, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;

// Inserts a CodeNamespace at index 0 of the collection.
collection.Insert( 0, new CodeNamespace("TestNamespace")
 );

// Removes the specified CodeNamespace from the collection.
CodeNamespace namespace_ = new CodeNamespace("TestNamespace");
collection.Remove( namespace_ );

// Removes the CodeNamespace at index 0.
collection.RemoveAt(0);
// Creates an empty CodeNamespaceCollection.            
CodeNamespaceCollection^ collection = gcnew CodeNamespaceCollection;

// Adds a CodeNamespace to the collection.
collection->Add( gcnew CodeNamespace( "TestNamespace" ) );

// Adds an array of CodeNamespace objects to the collection.
array<CodeNamespace^>^namespaces = {gcnew CodeNamespace( "TestNamespace1"
 ),gcnew CodeNamespace( "TestNamespace2" )};
collection->AddRange( namespaces );

// Adds a collection of CodeNamespace objects to the collection.
CodeNamespaceCollection^ namespacesCollection = gcnew CodeNamespaceCollection;
namespacesCollection->Add( gcnew CodeNamespace( "TestNamespace1" ) );
namespacesCollection->Add( gcnew CodeNamespace( "TestNamespace2" ) );
collection->AddRange( namespacesCollection );

// Tests for the presence of a CodeNamespace in the collection,
// and retrieves its index if it is found.
CodeNamespace^ testNamespace = gcnew CodeNamespace( "TestNamespace" );
int itemIndex = -1;
if ( collection->Contains( testNamespace ) )
   itemIndex = collection->IndexOf( testNamespace );

// Copies the contents of the collection beginning at index 0,
// to the specified CodeNamespace array.
// 'namespaces' is a CodeNamespace array.
collection->CopyTo( namespaces, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;

// Inserts a CodeNamespace at index 0 of the collection.
collection->Insert( 0, gcnew CodeNamespace( "TestNamespace" ) );

// Removes the specified CodeNamespace from the collection.
CodeNamespace^ namespace_ = gcnew CodeNamespace( "TestNamespace" );
collection->Remove( namespace_ );

// Removes the CodeNamespace at index 0.
collection->RemoveAt( 0 );
// Creates an empty CodeNamespaceCollection.            
CodeNamespaceCollection collection = new CodeNamespaceCollection();

// Adds a CodeNamespace to the collection.
collection.Add(new CodeNamespace("TestNamespace"));

// Adds an array of CodeNamespace objects to the collection.
CodeNamespace namespaces[] = {
    new CodeNamespace("TestNamespace1"), new
 
    CodeNamespace("TestNamespace2")
};
collection.AddRange(namespaces);
// Adds a collection of CodeNamespace objects to the collection.
CodeNamespaceCollection namespacesCollection = new 
    CodeNamespaceCollection();
namespacesCollection.Add(new CodeNamespace("TestNamespace1"));
namespacesCollection.Add(new CodeNamespace("TestNamespace2"));
collection.AddRange(namespacesCollection);

// Tests for the presence of a CodeNamespace in the collection,
// and retrieves its index if it is found.
CodeNamespace testNamespace = new CodeNamespace("TestNamespace");
int itemIndex = -1;
if (collection.Contains(testNamespace)) {
    itemIndex = collection.IndexOf(testNamespace);
}

// Copies the contents of the collection beginning at index 0,
// to the specified CodeNamespace array.
// 'namespaces' is a CodeNamespace array.
collection.CopyTo(namespaces, 0);

// Retrieves the count of the items in the collection.
int collectionCount = collection.get_Count();

// Inserts a CodeNamespace at index 0 of the collection.
collection.Insert(0, new CodeNamespace("TestNamespace"));

// Removes the specified CodeNamespace from the collection.
CodeNamespace namespace_ = new CodeNamespace("TestNamespace");
collection.Remove(namespace_);

// Removes the CodeNamespace at index 0.
collection.RemoveAt(0);
継承階層継承階層
System.Object
   System.Collections.CollectionBase
    System.CodeDom.CodeNamespaceCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeNamespaceCollection メンバ
System.CodeDom 名前空間
CodeNamespace クラス



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CodeNamespaceCollection クラス」の関連用語

CodeNamespaceCollection クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CodeNamespaceCollection クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS