Share via


ResolutionGroupNameAttribute 类

定义

标识组名的属性,通常是公司名称或反向公司 URL,提供了效果名称的作用域。

[System.AttributeUsage(System.AttributeTargets.Assembly)]
public sealed class ResolutionGroupNameAttribute : Attribute
type ResolutionGroupNameAttribute = class
    inherit Attribute
继承
System.Attribute
ResolutionGroupNameAttribute
属性
System.AttributeUsageAttribute

注解

开发人员必须向 ExportEffectAttribute 提供一个名称,该名称在提供给 的 范围内是唯一的 ResolutionGroupNameAttributeResolve(String)方法采用 (解析组名) '.'和提供给 ExportEffectAttribute的唯一名称串联的字符串name,并返回指定效果。

例如,使用 声明:

[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"));

构造函数

ResolutionGroupNameAttribute(String)

新建解析组名称属性。

适用于