Policy 构造函数 (PolicyStore, String)

Initializes a new instance of the Policy class.

命名空间:  Microsoft.SqlServer.Management.Dmf
程序集:  Microsoft.SqlServer.Dmf(在 Microsoft.SqlServer.Dmf.dll 中)

语法

声明
Public Sub New ( _
    parent As PolicyStore, _
    name As String _
)
用法
Dim parent As PolicyStore
Dim name As String

Dim instance As New Policy(parent, _
    name)
public Policy(
    PolicyStore parent,
    string name
)
public:
Policy(
    PolicyStore^ parent, 
    String^ name
)
new : 
        parent:PolicyStore * 
        name:string -> Policy
public function Policy(
    parent : PolicyStore, 
    name : String
)

参数

示例

C#

Policy p = new Policy(ps, policyName);
p.AutomatedPolicyEvaluationMode = execMode;
p.Condition = condition.Name;
p.ScheduleUid = schedule.ScheduleUid;
if (execMode != AutomatedPolicyEvaluationMode.None) p.Enabled = true;
p.Create();