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

CodeNamespaceImport クラス

使用する名前空間を示す名前空間インポート ディレクティブ表します

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

<SerializableAttribute> _
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class CodeNamespaceImport
    Inherits CodeObject
Dim instance As CodeNamespaceImport
[SerializableAttribute] 
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] 
[ComVisibleAttribute(true)] 
public class CodeNamespaceImport : CodeObject
[SerializableAttribute] 
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] 
[ComVisibleAttribute(true)] 
public ref class CodeNamespaceImport : public
 CodeObject
/** @attribute SerializableAttribute() */ 
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
/** @attribute ComVisibleAttribute(true) */ 
public class CodeNamespaceImport extends CodeObject
SerializableAttribute 
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) 
ComVisibleAttribute(true) 
public class CodeNamespaceImport extends
 CodeObject
解説解説
使用例使用例

CodeNamespaceImport使用して CodeNamespaceImport 名前空間インポートするコード例次に示します

' Declares a compile unit to contain a namespace.
Dim compileUnit As New CodeCompileUnit()

' Declares a namespace named TestNamespace.
Dim testNamespace As New
 CodeNamespace("TestNamespace")
' Adds the namespace to the namespace collection of the compile unit.
compileUnit.Namespaces.Add(testNamespace)

' Declares a namespace import of the System namespace.
Dim import1 As New CodeNamespaceImport("System")
' Adds the namespace import to the namespace imports collection of the
 namespace.
testNamespace.Imports.Add(import1)

' A Visual Basic code generator produces the following source code for
 the preceeding example code:

'Option Strict Off
'Option Explicit On
'
'Imports System
'
'Namespace TestNamespace
'End Namespace

// Declares a compile unit to contain a namespace.
CodeCompileUnit compileUnit = new CodeCompileUnit();

// Declares a namespace named TestNamespace.
CodeNamespace testNamespace = new CodeNamespace("TestNamespace");
// Adds the namespace to the namespace collection of the compile unit.
compileUnit.Namespaces.Add(testNamespace);

// Declares a namespace import of the System namespace.
CodeNamespaceImport import1 = new CodeNamespaceImport("System");
// Adds the namespace import to the namespace imports collection of
 the namespace.
testNamespace.Imports.Add(import1);

// A C# code generator produces the following source code for the preceeding
 example code:

//    namespace TestNamespace {        
//        using System;
//
//  }

// Declares a compile unit to contain a namespace.
CodeCompileUnit^ compileUnit = gcnew CodeCompileUnit;

// Declares a namespace named TestNamespace.
CodeNamespace^ testNamespace = gcnew CodeNamespace( "TestNamespace" );

// Adds the namespace to the namespace collection of the compile unit.
compileUnit->Namespaces->Add( testNamespace );

// Declares a namespace import of the System namespace.
CodeNamespaceImport^ import1 = gcnew CodeNamespaceImport( "System" );

// Adds the namespace import to the namespace imports collection of
 the namespace.
testNamespace->Imports->Add( import1 );

// A C# code generator produces the following source code for the preceeding
 example code:
//    namespace TestNamespace {        
//        using System;
//
//  }
// Declares a compile unit to contain a namespace.
CodeCompileUnit compileUnit = new CodeCompileUnit();
// Declares a namespace named TestNamespace.
CodeNamespace testNamespace = new CodeNamespace("TestNamespace");
// Adds the namespace to the namespace collection of the compile unit.
compileUnit.get_Namespaces().Add(testNamespace);
// Declares a namespace import of the System namespace.
CodeNamespaceImport import1 = new CodeNamespaceImport("System");
// Adds the namespace import to the namespace imports collection 
// of the namespace.
testNamespace.get_Imports().Add(import1);
// A VJ# code generator produces the following source code for
// the preceeding example code:
//    package TestNamespace;   
//    import System;
継承階層継承階層
System.Object
   System.CodeDom.CodeObject
    System.CodeDom.CodeNamespaceImport
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeNamespaceImport メンバ
System.CodeDom 名前空間
CodeNamespaceImportCollection



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

辞書ショートカット

すべての辞書の索引

「CodeNamespaceImport クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS