CodeMemberMethod.TypeParameters 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
현재 제네릭 메서드의 형식 매개 변수를 가져옵니다.
public:
property System::CodeDom::CodeTypeParameterCollection ^ TypeParameters { System::CodeDom::CodeTypeParameterCollection ^ get(); };
public System.CodeDom.CodeTypeParameterCollection TypeParameters { get; }
[System.Runtime.InteropServices.ComVisible(false)]
public System.CodeDom.CodeTypeParameterCollection TypeParameters { get; }
member this.TypeParameters : System.CodeDom.CodeTypeParameterCollection
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.TypeParameters : System.CodeDom.CodeTypeParameterCollection
Public ReadOnly Property TypeParameters As CodeTypeParameterCollection
속성 값
제네릭 메서드의 형식 매개 변수가 포함된 CodeTypeParameterCollection입니다.
- 특성
예제
다음 코드 예제에서는 사용 TypeParameters 하는 속성에 두 가지 형식 매개 변수를 추가 하는 합니다 CodeMemberMethodprintMethod
. 이 예제는에 대해 제공 된 큰 예제의 일부는 CodeTypeParameter 클래스입니다.
// Declare a generic method.
CodeMemberMethod printMethod = new CodeMemberMethod();
CodeTypeParameter sType = new CodeTypeParameter("S");
sType.HasConstructorConstraint = true;
CodeTypeParameter tType = new CodeTypeParameter("T");
sType.HasConstructorConstraint = true;
printMethod.Name = "Print";
printMethod.TypeParameters.Add(sType);
printMethod.TypeParameters.Add(tType);
' Declare a generic method.
Dim printMethod As New CodeMemberMethod()
Dim sType As New CodeTypeParameter("S")
sType.HasConstructorConstraint = True
Dim tType As New CodeTypeParameter("T")
tType.HasConstructorConstraint = True
printMethod.Name = "Print"
printMethod.TypeParameters.Add(sType)
printMethod.TypeParameters.Add(tType)
설명
제네릭 메서드에는 형식 매개 변수라고 하는 하나 이상의 지정되지 않은 형식이 포함되어 있습니다. 형식 매개 변수 이름은 제네릭 선언 본문 내의 형식을 의미합니다.
적용 대상
추가 정보
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기