PolicyCategory 类

Represents a category that classifies policies in SQL Server Policy-Based Management. Policy Categories are used to group policies together to which target objects can subscribe.

继承层次结构

System. . :: . .Object
  Microsoft.SqlServer.Management.Sdk.Sfc. . :: . .SfcInstance
    Microsoft.SqlServer.Management.Dmf..::..PolicyCategory

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

语法

声明
<StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey := "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")> _
Public NotInheritable Class PolicyCategory _
    Inherits SfcInstance _
    Implements ISfcCreatable, ICreatable, ISfcDroppable, IDroppable,  _
    ISfcAlterable, IAlterable, ISfcRenamable, IRenamable
用法
Dim instance As PolicyCategory
[StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey = "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")]
public sealed class PolicyCategory : SfcInstance, 
    ISfcCreatable, ICreatable, ISfcDroppable, IDroppable, ISfcAlterable, 
    IAlterable, ISfcRenamable, IRenamable
[StrongNameIdentityPermissionAttribute(SecurityAction::LinkDemand, PublicKey = L"0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")]
public ref class PolicyCategory sealed : public SfcInstance, 
    ISfcCreatable, ICreatable, ISfcDroppable, IDroppable, ISfcAlterable, 
    IAlterable, ISfcRenamable, IRenamable
[<SealedAttribute>]
[<StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey = "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")>]
type PolicyCategory =  
    class
        inherit SfcInstance
        interface ISfcCreatable
        interface ICreatable
        interface ISfcDroppable
        interface IDroppable
        interface ISfcAlterable
        interface IAlterable
        interface ISfcRenamable
        interface IRenamable
    end
public final class PolicyCategory extends SfcInstance implements ISfcCreatable, ICreatable, ISfcDroppable, IDroppable, ISfcAlterable, IAlterable, ISfcRenamable, IRenamable

PolicyCategory 类型公开以下成员。

构造函数

  名称 说明
公共方法 PolicyCategory() () () () Initializes a new instance of the PolicyCategory class.
公共方法 PolicyCategory(PolicyStore, String) Initializes a new instance of the PolicyCategory class.

页首

属性

  名称 说明
受保护属性 AbstractIdentityKey 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共属性静态成员 DefaultCategory Gets the category to which the policy is assigned by default.
公共属性 ID Gets the ID value that uniquely identifies the policy category.
公共属性 IdentityKey Gets the key that uniquely identifies the policy category.
公共属性 MandateDatabaseSubscriptions Gets or sets the Boolean value that determines whether the database subscriptions are permitted.
公共属性 Metadata Returns metadata about the instance and its domain. (从 SfcInstance 继承。)
公共属性 Name Gets the name of the policy category.
公共属性 Parent Gets or sets the parent instance via the keychain.
公共属性 Properties Returns a collection instance properties. (从 SfcInstance 继承。)
受保护属性 PropertyStorageProvider 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护属性 State Returns the state of the SfcInstance object. (从 SfcInstance 继承。)
公共属性 Urn Returns the uniform resource name of the SfcInstance object. (从 SfcInstance 继承。)

页首

方法

  名称 说明
公共方法 Alter Updates any PolicyCategory object property changes on the instance of SQL Server.
受保护方法 AlterImpl 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 CheckObjectCreated 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 CheckObjectState 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共方法 Create Creates a category for the PolicyCategory class.
受保护方法 CreateIdentityKey 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 CreateImpl 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共方法 Discover 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共方法 Drop Removes the policy category from the instance of SQL Server.
受保护方法 DropImpl 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共方法 Equals (从 Object 继承。)
受保护方法 Finalize (从 Object 继承。)
受保护方法 GetChildCollection 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共方法 GetDomain 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共方法 GetHashCode (从 Object 继承。)
公共方法静态成员 GetObjectFactory Gets the object factory for the object.
公共方法 GetPropertySet Returns the set of properties for the SfcInstance object. (从 SfcInstance 继承。)
公共方法 GetType (从 Object 继承。)
受保护方法 GetTypeMetadataImpl Indicates the domains that override by returning the right TypeMetadata class directly. 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 InitializeUIPropertyState 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 MarkForDropImpl Returns a value that indicates the existing objects to be dropped. 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 MarkRootAsConnected 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 MemberwiseClone (从 Object 继承。)
受保护方法 MoveImpl Indicates the new parent object to move in an instance. 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 OnPropertyMetadataChanges Invoked whenever the effective value of any SfcInstance metadata is updated. (从 SfcInstance 继承。)
受保护方法 OnPropertyValueChanges Invoked whenever the effective value of any SfcInstance property is updated. (从 SfcInstance 继承。)
受保护方法 PostAlter 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 PostCreate Indicates the default implementor that creates the execution result. 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 PostDrop 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 PostMove 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 PostRename 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共方法 Refresh Refreshes the object's properties by reading them from the server. (从 SfcInstance 继承。)
公共方法 Rename Renames the policy.
受保护方法 RenameImpl 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 ResetKey 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共方法 Serialize Serializes the instance to XML. (从 SfcInstance 继承。)
公共方法 ToString Returns a string representation of the instance Urn. (从 SfcInstance 继承。)
受保护方法 UpdateUIPropertyState 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
受保护方法 Validate Indicates the basic child object's validation. 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)

页首

事件

  名称 说明
受保护事件 propertyChanged 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共事件 PropertyChanged CLS-compliant event for property changes. (从 SfcInstance 继承。)
受保护事件 propertyMetadataChanged 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。 (从 SfcInstance 继承。)
公共事件 PropertyMetadataChanged CLS-compliant event for property metadata changes. (从 SfcInstance 继承。)

页首

显式接口实现

  名称 说明
显式接口实现私有方法 ISfcAlterable. . :: . .ScriptAlter Alters the script that is used to create the policy. 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。.
显式接口实现私有方法 ISfcCreatable. . :: . .ScriptCreate Creates a script that is used to create the policy. 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。.
显式接口实现私有方法 ISfcDroppable. . :: . .ScriptDrop Drops the script that is used to create the policy. 不要在您的代码中直接引用此成员。它支持 SQL Server 基础结构。
显式接口实现私有方法 ISfcRenamable. . :: . .Rename Renames the policy with the specified key.
显式接口实现私有方法 ISfcRenamable. . :: . .ScriptRename Renames the script that is used to create the policy with the specified key.

页首

注释

Using the PolicyCategory object you can:

  • Create a policy category to which target objects can subscribe.

  • Specify the policy category to use in a subscription

示例

C#

PolicyCategorySubscription policyCatSub = new PolicyCategorySubscription(ps);
policyCatSub.PolicyCategory = category;
policyCatSub.TargetType = targetType;
policyCatSub.Target = targetObject;
policyCatSub.Create();

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。