OrCondition Class
Defines a set of Condition objects to be logically evaluated using OR Boolean logic. This class cannot be inherited.
Espacio de nombres: Microsoft.SqlServer.NotificationServices.Rules
Ensamblado: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)
'Declaración
Public Class OrCondition
Inherits ConditionTree
public class OrCondition : ConditionTree
public ref class OrCondition : public ConditionTree
public class OrCondition extends ConditionTree
public class OrCondition extends ConditionTree
When an OrCondition tree is added to a rule, the tree evaluates to true if any child conditions is true.
You must specify at least one child condition using the OrCondition constructor or the inherited Children property.
System.Object
Microsoft.SqlServer.NotificationServices.Rules.RuleObject
Microsoft.SqlServer.NotificationServices.Rules.Condition
Microsoft.SqlServer.NotificationServices.Rules.ConditionTree
Microsoft.SqlServer.NotificationServices.Rules.OrCondition
The following example shows how to use an OrCondition object to define a Condition for a Notification Services subscription. This condition consists of two SimpleLeafCondition objects. If either SimpleLeafCondition object evaluates to true, the OrCondition is true.
// Create the NSInstance object.
NSInstance testInstance =
new NSInstance("InventoryTrackerInstance");
// Create the NSApplication object.
NSApplication testApplication =
new NSApplication(testInstance, "InventoryTracker");
// Define subscription properties
Subscription s = new Subscription(testApplication, "InventoryTrackerSubscriptions");
s.SubscriberId = "TestUser1";
s.Enabled = true;
s.RuleName = "InventoryTrackerRule";
s["DeviceName"] = "Work e-mail";
s["SubscriberLocale"] = "en-US";
// Define OrCondition
s.Condition = new OrCondition(
new SimpleLeafCondition(new FieldValue("Quantity"),
SimpleOperator.GreaterThanOrEqualTo,
500),
new SimpleLeafCondition(new FieldValue("Quantity"),
SimpleOperator.LessThanOrEqualTo,
35)
);
// Add subscription
s.Add();
' Create the NSInstance object.
Dim testInstance As New NSInstance("InventoryTrackerInstance")
' Create the NSApplication object.
Dim testApplication As _
New NSApplication(testInstance, "InventoryTracker")
' Define subscription properties
Dim s As New Subscription( _
testApplication, "InventoryTrackerSubscriptions")
s.SubscriberId = "TestUser1"
s.Enabled = True
s.RuleName = "InventoryTrackerRule"
s("DeviceName") = "Work e-mail"
s("SubscriberLocale") = "en-US"
' Define OrCondition
s.Condition = New OrCondition( _
New SimpleLeafCondition( _
New FieldValue("Quantity"), _
SimpleOperator.GreaterThanOrEqualTo, _
500), _
New SimpleLeafCondition( _
New FieldValue("Quantity"), _
SimpleOperator.LessThanOrEqualTo, _
35))
' Add subscription
s.Add()
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
OrCondition Members
Microsoft.SqlServer.NotificationServices.Rules Namespace