BooleanLeafCondition Class
Evaluates to true if the Boolean-valued Argument has a value of true; otherwise, it evaluates to false. This class cannot be inherited.
Espacio de nombres: Microsoft.SqlServer.NotificationServices.Rules
Ensamblado: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)
Sintaxis
'Declaración
Public Class BooleanLeafCondition
Inherits LeafCondition
public class BooleanLeafCondition : LeafCondition
public ref class BooleanLeafCondition : public LeafCondition
public class BooleanLeafCondition extends LeafCondition
public class BooleanLeafCondition extends LeafCondition
Notas
You must set the Argument property using the BooleanLeafCondition constructor or the property.
Inheritance Hierarchy
System.Object
Microsoft.SqlServer.NotificationServices.Rules.RuleObject
Microsoft.SqlServer.NotificationServices.Rules.Condition
Microsoft.SqlServer.NotificationServices.Rules.LeafCondition
Microsoft.SqlServer.NotificationServices.Rules.BooleanLeafCondition
Ejemplo
Instead of checking a field or using a function, the condition in this example simply sets the Boolean value to true, resulting in notifications for all events. This could be used in an enterprise monitoring subscription or a subscription used to verify that the Notification Services application is generating notifications as expected:
// Create subscription and define basic properties.
s = new Subscription(nsApplication, subscriptionClassName);
s.SubscriberId = "David";
s.Enabled = true;
s.RuleName = "InventoryTrackerRule";
s.SetFieldValue("DeviceName", "myDevice");
s.SetFieldValue("SubscriberLocale", "en-us");
// Define a condition that is true for all events.
s.Condition = new BooleanLeafCondition(true);
// Add subscription.
s.Add();
Seguridad para subprocesos
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.
Plataformas
Plataformas de desarrollo
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
Plataformas de destino
Para obtener una lista de las plataformas compatibles, vea Requisitos de hardware y software para instalar SQL Server 2005.
Vea también
Referencia
BooleanLeafCondition Members
Microsoft.SqlServer.NotificationServices.Rules Namespace