Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Initializes a new instance of the RuleValue class with a RuleLogic instance.
Namespace: Microsoft.SqlServer.NotificationServices.Rules
Assembly : Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)
Syntax
'Declaration
Public Sub New ( _
rule As RuleLogic _
)
public RuleValue (
RuleLogic rule
)
public:
RuleValue (
RuleLogic^ rule
)
public RuleValue (
RuleLogic rule
)
public function RuleValue (
rule : RuleLogic
)
Parameter
Hinweise
The specified RuleLogic instance must have the same InputType value as the rule or condition you are defining.
A RuleLogic instance of type FilterRule has a Boolean return value; an instance of type PropertyRule has a return type determined by the Result property.
Beispiel
The following example shows how to use a rule value to obtain the logic for a SimpleLeafCondition from a PropertyRule. The SimpleLeafCondition to evaluate the Quantity field for a value that matches the definition of 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();
Plattformen
Entwicklungsplattformen
Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.
Zielplattforme
Eine Liste der unterstützten Plattformen finden Sie unterHardware- und Softwareanforderungen für die Installation von SQL Server 2005.
Siehe auch
Verweis
RuleValue Class
RuleValue Members
Microsoft.SqlServer.NotificationServices.Rules Namespace