PropertyRule Constructor (InputType, PropertyStatement[])
Initializes a new instance of the FilterRule class with a table or view input and one or more property statements.
네임스페이스: Microsoft.SqlServer.NotificationServices.Rules
어셈블리: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)
구문
‘선언
Public Sub New ( _
inputType As InputType, _
ParamArray propertyStatements As PropertyStatement() _
)
public PropertyRule (
InputType inputType,
params PropertyStatement[] propertyStatements
)
public:
PropertyRule (
InputType^ inputType,
... array<PropertyStatement^>^ propertyStatements
)
public PropertyRule (
InputType inputType,
PropertyStatement[] propertyStatements
)
public function PropertyRule (
inputType : InputType,
... propertyStatements : PropertyStatement[]
)
매개 변수
- inputType
The InputType that represents the input table or view. This parameter sets the InputType property.
- propertyStatements
Zero or more PropertyStatement objects used to evaluate the input. This parameter sets the PropertyStatements property.
주의
If you define zero PropertyStatement objects using the propertyStatements parameter, you must define at least one PropertyStatement using the PropertyStatements property. If you define multiple statements, the result of evaluating this rule is the result of the first statement with a matching Condition criteria, or NULL if no criteria is met.
예
The following example shows how to define a property rule that defines three properties: Few, Some, and Alot. It uses this property rule to define a subscription to events where Quantity equals Few:
// Define a new property that defines "Few," "Some," and "Alot"
// of inventory.
PropertyRule quantityCategory = new PropertyRule(
new ViewInputType(eventView),
new PropertyStatement(new SimpleLeafCondition(
new FieldValue("Quantity"),
SimpleOperator.LessThan, 100), "Few"),
new PropertyStatement(new BetweenLeafCondition(
new FieldValue("Quantity"), 100, 200), "Some"),
new PropertyStatement(new SimpleLeafCondition(
new FieldValue("Quantity"),
SimpleOperator.GreaterThan, 200),
"Alot"));
// Create subscription and define basic properties.
s = new Subscription(nsApplication, subscriptionClassName);
s.SubscriberId = "Scott";
s.Enabled = true;
s.RuleName = "InventoryTrackerRule";
s.SetFieldValue("DeviceName", "myDevice");
s.SetFieldValue("SubscriberLocale", "en-us");
// Use the new property to return only products with "few" remaining
// in inventory. Note that the category definition can be reused.
s.Condition = new SimpleLeafCondition(
new RuleValue(quantityCategory),
SimpleOperator.Equals,
"Few");
// Add subscription.
s.Add();
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
PropertyRule Class
PropertyRule Members
Microsoft.SqlServer.NotificationServices.Rules Namespace