CodeEntryPointMethod 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
실행 파일의 진입점 메서드를 나타냅니다.
public ref class CodeEntryPointMethod : System::CodeDom::CodeMemberMethod
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeEntryPointMethod : System.CodeDom.CodeMemberMethod
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeEntryPointMethod = class
inherit CodeMemberMethod
Public Class CodeEntryPointMethod
Inherits CodeMemberMethod
- 상속
- 특성
예제
이 예제에서는 프로그램 실행을 시작할 메서드를 나타내기 위해 a CodeEntryPointMethod 를 사용하는 방법을 보여 줍니다.
// 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
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
설명
A CodeEntryPointMethod 는 CodeMemberMethod 실행 파일의 진입점 메서드를 나타내는 것입니다.
생성자
| Name | Description |
|---|---|
| CodeEntryPointMethod() |
CodeEntryPointMethod 클래스의 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| Attributes |
멤버의 특성을 가져오거나 설정합니다. (다음에서 상속됨 CodeTypeMember) |
| Comments |
형식 멤버에 대한 주석 컬렉션을 가져옵니다. (다음에서 상속됨 CodeTypeMember) |
| CustomAttributes |
멤버의 사용자 지정 특성을 가져오거나 설정합니다. (다음에서 상속됨 CodeTypeMember) |
| EndDirectives |
멤버의 끝 지시문을 가져옵니다. (다음에서 상속됨 CodeTypeMember) |
| ImplementationTypes |
속성으로 표시되는 프라이빗 메서드 구현이 아니면 이 메서드에서 구현하는 인터페이스의 데이터 형식을 PrivateImplementationType 가져옵니다. (다음에서 상속됨 CodeMemberMethod) |
| LinePragma |
형식 멤버 문이 발생하는 줄을 가져오거나 설정합니다. (다음에서 상속됨 CodeTypeMember) |
| Name |
멤버의 이름을 가져오거나 설정합니다. (다음에서 상속됨 CodeTypeMember) |
| Parameters |
메서드에 대한 매개 변수 선언을 가져옵니다. (다음에서 상속됨 CodeMemberMethod) |
| PrivateImplementationType |
이 메서드가 private인 경우 인터페이스의 데이터 형식을 가져오거나 설정하며, 있는 경우 메서드를 구현합니다. (다음에서 상속됨 CodeMemberMethod) |
| ReturnType |
메서드 반환 값의 데이터 형식을 가져오거나 설정합니다. (다음에서 상속됨 CodeMemberMethod) |
| ReturnTypeCustomAttributes |
메서드의 반환 형식에 대한 사용자 지정 특성을 가져옵니다. (다음에서 상속됨 CodeMemberMethod) |
| StartDirectives |
멤버에 대한 시작 지시문을 가져옵니다. (다음에서 상속됨 CodeTypeMember) |
| Statements |
메서드 내의 문을 가져옵니다. (다음에서 상속됨 CodeMemberMethod) |
| TypeParameters |
현재 제네릭 메서드의 형식 매개 변수를 가져옵니다. (다음에서 상속됨 CodeMemberMethod) |
| UserData |
현재 개체에 대한 사용자 정의 데이터를 가져옵니다. (다음에서 상속됨 CodeObject) |
메서드
| Name | Description |
|---|---|
| Equals(Object) |
지정한 개체와 현재 개체가 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 작동합니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
이벤트
| Name | Description |
|---|---|
| PopulateImplementationTypes |
컬렉션에 처음 액세스할 때 ImplementationTypes 발생하는 이벤트입니다. (다음에서 상속됨 CodeMemberMethod) |
| PopulateParameters |
컬렉션에 처음 액세스할 때 Parameters 발생하는 이벤트입니다. (다음에서 상속됨 CodeMemberMethod) |
| PopulateStatements |
컬렉션에 처음 액세스할 때 Statements 발생하는 이벤트입니다. (다음에서 상속됨 CodeMemberMethod) |