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) 成员都是线程安全的。不保证所有实例成员都是线程安全的。