ProtocolAttribute 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Objective-C 프로토콜을 나타내는 인터페이스에 적용되는 특성입니다.
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface)]
public sealed class ProtocolAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface)>]
type ProtocolAttribute = class
inherit Attribute
- 상속
-
ProtocolAttribute
- 특성
설명
Xamarin.iOS는 이 특성을 가진 모든 인터페이스를 프로토콜로 Objective-C로 내보내고, 이러한 인터페이스를 구현하는 모든 클래스는 Objective-C로 내보낼 때 해당 프로토콜을 구현하는 것으로 표시됩니다.
// This will create an Objective-C protocol called 'IMyProtocol', with one required member ('requiredMethod')
[Protocol ("IMyProtocol")]
interface IMyProtocol
{
[Export ("requiredMethod")]
void RequiredMethod ();
}
// This will export the equivalent of "@interface MyClass : NSObject <IMyProtocol>" to Objective-C.
class MyClass : NSObject, IMyProtocol
{
void RequiredMethod ()
{
}
}
생성자
| Name | Description |
|---|---|
| ProtocolAttribute() |
Objective-C 프로토콜을 나타내는 인터페이스에 적용되는 특성입니다. |
속성
| Name | Description |
|---|---|
| BackwardsCompatibleCodeGeneration |
이 속성은 바인딩 생성기에서 해당 프로토콜에 대해 이전 버전과 호환되는 코드를 생성할지 여부를 나타냅니다. 특히 이 속성이 true인 경우 바인딩 생성기는 모든 프로토콜 멤버에 대한 프로토콜 인터페이스에서 선택적 멤버 및 ProtocolMemberAttribute 특성에 대한 확장 메서드를 생성합니다. |
| FormalSince |
Objective-C 프로토콜을 나타내는 인터페이스에 적용되는 특성입니다. |
| IsInformal |
Objective-C 프로토콜이 비공식 프로토콜인지 여부입니다. |
| Name |
프로토콜의 이름입니다. |
| WrapperType |
이 프로토콜의 인스턴스를 래핑하는 데 사용할 수 있는 특정 관리되는 형식입니다. |