然而,如果您将一个宣告式安全性检查置于成员等级上,它只会套用至该成员,并覆写在类别等级上所指定的使用权限(如存在时)。
However, if you place a declarative security check at the member level, it applies to only that member and overrides the permission specified at the class level, if one exists.
您可以使用宣告式语法将要求放在程序码的类别或方法等级。
You can use declarative syntax to place a demand at either the class or the method level of your code.
在这个范例中,宣告式呼叫被直接放入类别定义之前,表示这个使用权限将被套用至该类别等级。
In this example, the declarative call is placed directly before the class definition, specifying that this permission be applied to the class level.
应用推荐