ResolutionGroupNameAttribute 类

定义

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

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

注解

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

例如,声明如下:

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

新建解析组名称属性。

适用于