CodeEntryPointMethodとは? わかりやすく解説

CodeEntryPointMethod イベント


パブリック イベントパブリック イベント

  名前 説明
パブリック イベント PopulateImplementationTypes  ImplementationTypes コレクション最初にアクセスされたときに発生するイベント。 ( CodeMemberMethod から継承されます。)
パブリック イベント PopulateParameters  Parameters コレクション最初にアクセスされたときに発生するイベント。 ( CodeMemberMethod から継承されます。)
パブリック イベント PopulateStatements  Statements コレクション最初にアクセスされたときに発生するイベント。 ( CodeMemberMethod から継承されます。)
参照参照

関連項目

CodeEntryPointMethod クラス
System.CodeDom 名前空間
CodeMemberMethod

CodeEntryPointMethod クラス

実行可能ファイルのエントリ ポイント メソッド表します

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

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

CodeEntryPointMethod は、実行可能ファイルのエントリ ポイント メソッドを表す CodeMemberMethod です。

使用例使用例

CodeEntryPointMethod使用してプログラムの実行開始するメソッドを示す例を次に示します

' Builds a Hello World Program Graph using System.CodeDom objects
Public Shared Function BuildHelloWorldGraph()
 As CodeCompileUnit
   ' Create a new CodeCompileUnit to contain the program graph
   Dim CompileUnit As New
 CodeCompileUnit()
   
   ' Declare a new namespace object and name it
   Dim Samples As New CodeNamespace("Samples")
   ' Add the namespace object to the compile unit
   CompileUnit.Namespaces.Add(Samples)
   
   ' Add a new namespace import for the System namespace
   Samples.Imports.Add(New CodeNamespaceImport("System"))
   
   ' Declare a new type object and name it
   Dim Class1 As New CodeTypeDeclaration("Class1")
   ' Add the new type to the namespace object's type collection
   Samples.Types.Add(Class1)
   
   ' Declare a new code entry point method
   Dim Start As New CodeEntryPointMethod()
   ' Create a new method invoke expression
   Dim cs1 As New CodeMethodInvokeExpression(New
 CodeTypeReferenceExpression("System.Console"), "WriteLine",
 New CodePrimitiveExpression("Hello World!"))
   ' Call the System.Console.WriteLine method
   ' Pass a primitive string parameter to the WriteLine method
   ' Add the new method code statement
   Start.Statements.Add(New CodeExpressionStatement(cs1))
   
   ' Add the code entry point method to the type's members collection
   Class1.Members.Add(Start)
   
   Return CompileUnit

End Function 'BuildHelloWorldGraph
         
// Builds a Hello World Program Graph using System.CodeDom objects
public static CodeCompileUnit BuildHelloWorldGraph()
{            
    // Create a new CodeCompileUnit to contain the program graph
    CodeCompileUnit CompileUnit = new CodeCompileUnit();

    // Declare a new namespace object and name it
    CodeNamespace Samples = new CodeNamespace("Samples");
    // Add the namespace object to the compile unit
    CompileUnit.Namespaces.Add( Samples );

    // Add a new namespace import for the System namespace
    Samples.Imports.Add( new CodeNamespaceImport("System")
 );            

    // Declare a new type object and name it
    CodeTypeDeclaration Class1 = new CodeTypeDeclaration("Class1");
    // Add the new type to the namespace object's type collection
    Samples.Types.Add(Class1);            

    // Declare a new code entry point method
    CodeEntryPointMethod Start = new CodeEntryPointMethod();
    // Create a new method invoke expression
    CodeMethodInvokeExpression cs1 = new CodeMethodInvokeExpression(
 
        // Call the System.Console.WriteLine method
        new CodeTypeReferenceExpression("System.Console"),
 "WriteLine", 
        // Pass a primitive string parameter to the WriteLine method
        new CodePrimitiveExpression("Hello World!")
 );
    // Add the new method code statement
    Start.Statements.Add(new CodeExpressionStatement(cs1));  
      

    // Add the code entry point method to the type's members collection
    Class1.Members.Add( Start );

    return CompileUnit;
// Builds a Hello World Program Graph using System.CodeDom objects
static CodeCompileUnit^ BuildHelloWorldGraph()
{
   
   // Create a new CodeCompileUnit to contain the program graph
   CodeCompileUnit^ CompileUnit = gcnew CodeCompileUnit;
   
   // Declare a new namespace object and name it
   CodeNamespace^ Samples = gcnew CodeNamespace( "Samples" );
   
   // Add the namespace object to the compile unit
   CompileUnit->Namespaces->Add( Samples );
   
   // Add a new namespace import for the System namespace
   Samples->Imports->Add( gcnew CodeNamespaceImport( "System" ) );
   
   // Declare a new type object and name it
   CodeTypeDeclaration^ Class1 = gcnew CodeTypeDeclaration( "Class1" );
   
   // Add the new type to the namespace object's type collection
   Samples->Types->Add( Class1 );
   
   // Declare a new code entry point method
   CodeEntryPointMethod^ Start = gcnew CodeEntryPointMethod;
   
   // Create a new method invoke expression
   array<CodeExpression^>^temp = {gcnew CodePrimitiveExpression( "Hello
 World!" )};
   CodeMethodInvokeExpression^ cs1 = gcnew CodeMethodInvokeExpression( gcnew CodeTypeReferenceExpression(
 "System.Console" ),"WriteLine",temp );
   
   // Add the new method code statement
   Start->Statements->Add( gcnew CodeExpressionStatement( cs1 ) );
   
   // Add the code entry point method to the type's members collection
   Class1->Members->Add( Start );
   return CompileUnit;
   
// Builds a Hello World Program Graph using System.CodeDom objects
public static CodeCompileUnit BuildHelloWorldGraph()
{
    // Create a new CodeCompileUnit to contain the program graph
    CodeCompileUnit compileUnit = new CodeCompileUnit();
    // Declare a new namespace object and name it
    CodeNamespace samples = new CodeNamespace("Samples");
    // Add the namespace object to the compile unit
    compileUnit.get_Namespaces().Add(samples);
    // Add a new namespace import for the System namespace
    samples.get_Imports().Add(new CodeNamespaceImport("System"));
    // Declare a new type object and name it
    CodeTypeDeclaration class1 = new CodeTypeDeclaration("Class1");
    // Add the new type to the namespace object's type collection
    samples.get_Types().Add(class1);
    // Declare a new code entry point method
    CodeEntryPointMethod start = new CodeEntryPointMethod();
    // Create a new method invoke expression
    CodeMethodInvokeExpression cs1 = new CodeMethodInvokeExpression(new
 
        CodeTypeReferenceExpression("System.Console"),
        "WriteLine", new CodeExpression[] { new
 
        CodePrimitiveExpression("Hello World!") });
    // Call the System.Console.WriteLine method
    // Pass a primitive string parameter to the WriteLine method
    // Add the new method code statement
    start.get_Statements().Add(new CodeExpressionStatement(cs1));
    // Add the code entry point method to the type's members collection
    class1.get_Members().Add(start);

    return compileUnit;
継承階層継承階層
System.Object
   System.CodeDom.CodeObject
     System.CodeDom.CodeTypeMember
       System.CodeDom.CodeMemberMethod
        System.CodeDom.CodeEntryPointMethod
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CodeEntryPointMethod メンバ
System.CodeDom 名前空間
CodeMemberMethod

CodeEntryPointMethod コンストラクタ


CodeEntryPointMethod プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Attributes  メンバ属性取得または設定します。 ( CodeTypeMember から継承されます。)
パブリック プロパティ Comments  メンバコメント コレクション取得します。 ( CodeTypeMember から継承されます。)
パブリック プロパティ CustomAttributes  メンバカスタム属性取得または設定します。 ( CodeTypeMember から継承されます。)
パブリック プロパティ EndDirectives  メンバ終了ディレクティブ取得します。 ( CodeTypeMember から継承されます。)
パブリック プロパティ ImplementationTypes  メソッド実装が PrivateImplementationType プロパティ示されるプライベート メソッド実装である場合除き、このメソッドによって実装されるインターフェイスデータ型取得します。 ( CodeMemberMethod から継承されます。)
パブリック プロパティ LinePragma  メンバステートメント発生する行を取得または設定します。 ( CodeTypeMember から継承されます。)
パブリック プロパティ Name  メンバの名前を取得または設定します。 ( CodeTypeMember から継承されます。)
パブリック プロパティ Parameters  メソッドパラメータ宣言取得します。 ( CodeMemberMethod から継承されます。)
パブリック プロパティ PrivateImplementationType  このメソッドによってプライベート メソッド実装されるインターフェイスがある場合に、そのインターフェイスデータ型取得または設定します。 ( CodeMemberMethod から継承されます。)
パブリック プロパティ ReturnType  メソッド戻り値データ型取得または設定します。 ( CodeMemberMethod から継承されます。)
パブリック プロパティ ReturnTypeCustomAttributes  メソッド戻り値の型のカスタム属性取得します。 ( CodeMemberMethod から継承されます。)
パブリック プロパティ StartDirectives  メンバ開始ディレクティブ取得します。 ( CodeTypeMember から継承されます。)
パブリック プロパティ Statements  メソッド内で、ステートメント取得します。 ( CodeMemberMethod から継承されます。)
パブリック プロパティ TypeParameters  現在のジェネリック メソッド型パラメータ取得します。 ( CodeMemberMethod から継承されます。)
パブリック プロパティ UserData  現在のオブジェクトユーザー定義可能なデータ取得または設定します。 ( CodeObject から継承されます。)
参照参照

関連項目

CodeEntryPointMethod クラス
System.CodeDom 名前空間
CodeMemberMethod

CodeEntryPointMethod メソッド


CodeEntryPointMethod メンバ

実行可能ファイルのエントリ ポイント メソッド表します

CodeEntryPointMethod データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド CodeEntryPointMethod CodeEntryPointMethod クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Attributes  メンバ属性取得または設定します。(CodeTypeMember から継承されます。)
パブリック プロパティ Comments  メンバコメント コレクション取得します。(CodeTypeMember から継承されます。)
パブリック プロパティ CustomAttributes  メンバカスタム属性取得または設定します。(CodeTypeMember から継承されます。)
パブリック プロパティ EndDirectives  メンバ終了ディレクティブ取得します。(CodeTypeMember から継承されます。)
パブリック プロパティ ImplementationTypes  メソッド実装が PrivateImplementationType プロパティ示されるプライベート メソッド実装である場合除き、このメソッドによって実装されるインターフェイスデータ型取得します。(CodeMemberMethod から継承されます。)
パブリック プロパティ LinePragma  メンバステートメント発生する行を取得または設定します。(CodeTypeMember から継承されます。)
パブリック プロパティ Name  メンバの名前を取得または設定します。(CodeTypeMember から継承されます。)
パブリック プロパティ Parameters  メソッドパラメータ宣言取得します。(CodeMemberMethod から継承されます。)
パブリック プロパティ PrivateImplementationType  このメソッドによってプライベート メソッド実装されるインターフェイスがある場合に、そのインターフェイスデータ型取得または設定します。(CodeMemberMethod から継承されます。)
パブリック プロパティ ReturnType  メソッド戻り値データ型取得または設定します。(CodeMemberMethod から継承されます。)
パブリック プロパティ ReturnTypeCustomAttributes  メソッド戻り値の型のカスタム属性取得します。(CodeMemberMethod から継承されます。)
パブリック プロパティ StartDirectives  メンバ開始ディレクティブ取得します。(CodeTypeMember から継承されます。)
パブリック プロパティ Statements  メソッド内で、ステートメント取得します。(CodeMemberMethod から継承されます。)
パブリック プロパティ TypeParameters  現在のジェネリック メソッド型パラメータ取得します。(CodeMemberMethod から継承されます。)
パブリック プロパティ UserData  現在のオブジェクトユーザー定義可能なデータ取得または設定します。(CodeObject から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
パブリック イベントパブリック イベント
  名前 説明
パブリック イベント PopulateImplementationTypes  ImplementationTypes コレクション最初にアクセスされたときに発生するイベント。(CodeMemberMethod から継承されます。)
パブリック イベント PopulateParameters  Parameters コレクション最初にアクセスされたときに発生するイベント。(CodeMemberMethod から継承されます。)
パブリック イベント PopulateStatements  Statements コレクション最初にアクセスされたときに発生するイベント。(CodeMemberMethod から継承されます。)
参照参照

関連項目

CodeEntryPointMethod クラス
System.CodeDom 名前空間
CodeMemberMethod



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

辞書ショートカット

すべての辞書の索引

「CodeEntryPointMethod」の関連用語

CodeEntryPointMethodのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS