ExportEffectAttribute 类

定义

使用唯一标识符识别 Effect 的特性,可与 Resolve(String) 配合使用以查找效果。

public ref class ExportEffectAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
public sealed class ExportEffectAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)>]
type ExportEffectAttribute = class
    inherit Attribute
Public NotInheritable Class ExportEffectAttribute
Inherits Attribute
继承
ExportEffectAttribute
属性

注解

开发人员必须提供在提供给 ResolutionGroupNameAttribute的值范围内唯一的名称。 该方法Resolve(String)采用一个字符串,该字符串是提供给ResolutionGroupNameAttribute“'”和提供给ExportEffectAttribute“”.的解析组名称的串联,并返回将具有该类型的effectType效果。

例如,声明如下:

[assembly: ResolutionGroupName ("com.YourCompany")]
[assembly: ExportEffect (typeof (ShadowEffect), "ShadowEffect")]

然后,下面的代码会将效果添加到按钮:

var button = new Button { Text = "I have a shadow" };
button.Effects.Add (Effect.Resolve ("com.YourCompany.ShadowEffect"));

构造函数

ExportEffectAttribute(Type, String)

创建一个新的 ExportEffectAttribute

适用于

另请参阅