共用方式為


CodeGroup.PolicyStatement 屬性

定義

取得或設定與程式碼群組相關的原則陳述式。

public:
 property System::Security::Policy::PolicyStatement ^ PolicyStatement { System::Security::Policy::PolicyStatement ^ get(); void set(System::Security::Policy::PolicyStatement ^ value); };
public System.Security.Policy.PolicyStatement PolicyStatement { get; set; }
member this.PolicyStatement : System.Security.Policy.PolicyStatement with get, set
Public Property PolicyStatement As PolicyStatement

屬性值

PolicyStatement

程式碼群組的原則陳述式。

範例

下列範例會設定 PolicyStatement 程式碼群組的 。

codeGroup->PolicyStatement = gcnew PolicyStatement( gcnew NamedPermissionSet( "MyPermissionSet" ) );
codeGroup.PolicyStatement = new PolicyStatement(new NamedPermissionSet("MyPermissionSet"));
codeGroup.PolicyStatement = New PolicyStatement(New NamedPermissionSet("MyPermissionSet"))

備註

當辨識項符合成員資格條件時,原則語句會套用至元件中的程式碼。

您也可以將原則語句傳遞至建構函式來設定這個屬性。

適用於