ExportAttribute 類別

定義

將方法或屬性匯出至 Objective-C 世界。

[System.AttributeUsage(System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property)]
public class ExportAttribute : Attribute
type ExportAttribute = class
    inherit Attribute
繼承
ExportAttribute
衍生
屬性

備註

這個屬性會套用至衍生 NSObject 自 的屬性和方法,以將值匯出至 Objective-C 世界。 這可用來回應訊息或覆寫 Objective-C 方法。

public class Test : SomeBaseClass {
    [Export ("setText:withFont:")]
    public void SetText (string text, string font)
    {
    }
}

建構函式

ExportAttribute()

使用這個方法可將 C# 方法、屬性或建構函式公開為可從 Objective-C 叫用的方法。

ExportAttribute(String)

使用指定的方法名稱,將指定的方法或屬性匯出至 Objective-C 登陸。

ExportAttribute(String, ArgumentSemantic)

使用這個方法可將 C# 方法、屬性或建構函式公開為可從 Objective-C 叫用的方法。

屬性

ArgumentSemantic

setter 屬性或方法上物件擁有權的語意。

IsVariadic

將方法或屬性匯出至 Objective-C 世界。

Selector

如果指定,則為 C# 選取器的名稱,如果衍生自屬性名稱或方法,則為 null。

方法

ToGetter(PropertyInfo)

將方法或屬性匯出至 Objective-C 世界。

ToSetter(PropertyInfo)

將方法或屬性匯出至 Objective-C 世界。

適用於