Share via


SimpleLeafCondition Class

関係演算子を使用して 2 つの Argument オブジェクトを比較し、ブール型の結果を返します。このクラスは継承できません。

名前空間: Microsoft.SqlServer.NotificationServices.Rules
アセンブリ: Microsoft.SqlServer.NotificationServices.Rules (microsoft.sqlserver.notificationservices.rules.dll 内)

構文

'宣言
Public Class SimpleLeafCondition
    Inherits LeafCondition
public class SimpleLeafCondition : LeafCondition
public ref class SimpleLeafCondition : public LeafCondition
public class SimpleLeafCondition extends LeafCondition
public class SimpleLeafCondition extends LeafCondition

解説

プロパティまたは SimpleLeafCondition コンストラクタを使用して、LeftRight および Operator プロパティを設定する必要があります。

継承階層

System.Object
   Microsoft.SqlServer.NotificationServices.Rules.RuleObject
     Microsoft.SqlServer.NotificationServices.Rules.Condition
       Microsoft.SqlServer.NotificationServices.Rules.LeafCondition
        Microsoft.SqlServer.NotificationServices.Rules.SimpleLeafCondition

使用例

次の例では、Notification Services でサブスクライバ向けの通知を生成するために、イベントが満たす必要がある条件を SimpleLeafCondition で定義する方法を示します。

// 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()

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

SimpleLeafCondition Members
Microsoft.SqlServer.NotificationServices.Rules Namespace