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

CodeTypeConstructor クラス

クラス静的コンストラクタ表します

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

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

CodeTypeConstructor使用して、型の静的コンストラクタ宣言する例を次に示します

' Declares a new type for a static constructor.
Dim type1 As New CodeTypeDeclaration("Type1")
' Declares a static constructor.
Dim constructor2 As New
 CodeTypeConstructor()
' Adds the static constructor to the type.
type1.Members.Add(constructor2)

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

'   Public Class Type1
'
'       Shared Sub New()            
'       End Sub
'   End Class
// Declares a new type for a static constructor.
CodeTypeDeclaration type1 = new CodeTypeDeclaration("Type1");
// Declares a static constructor.
CodeTypeConstructor constructor2 = new CodeTypeConstructor();
// Adds the static constructor to the type.
type1.Members.Add( constructor2 );

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

//    public class Type1 
//    {
//
//        static Type1() 
//        {
//        }       
//    }
// Declares a new type for a static constructor.
CodeTypeDeclaration^ type1 = gcnew CodeTypeDeclaration( "Type1" );

// Declares a static constructor.
CodeTypeConstructor^ constructor2 = gcnew CodeTypeConstructor;

// Adds the static constructor to the type.
type1->Members->Add( constructor2 );

// A C# code generator produces the following source code for the preceeding
 example code:
//    public class Type1 
//    {
//
//        static Type1() 
//        {
//        }       
//    }
// Declares a new type for a static constructor.
CodeTypeDeclaration type1 = new CodeTypeDeclaration("Type1");
// Declares a static constructor.
CodeTypeConstructor constructor2 = new CodeTypeConstructor();
// Adds the static constructor to the type.
type1.get_Members().Add(constructor2);
// A VJ# code generator produces the following source code for 
// the preceeding example code:
//public class Type1
//{
//  static {
//  } //Type1
//} //Type1
継承階層継承階層
System.Object
   System.CodeDom.CodeObject
     System.CodeDom.CodeTypeMember
       System.CodeDom.CodeMemberMethod
        System.CodeDom.CodeTypeConstructor
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeTypeConstructor メンバ
System.CodeDom 名前空間
CodeConstructor クラス



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

辞書ショートカット

すべての辞書の索引

「CodeTypeConstructor クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS