Share via


OrCondition Class

OR ブール論理によって論理的に評価される、一連の Condition オブジェクトを定義します。このクラスは継承できません。

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

構文

'宣言
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

解説

OrCondition ツリーがルールに追加されると、子条件のいずれかが true である場合、ツリーは true と評価されます。

OrCondition コンストラクタまたは継承される Children プロパティを使用して、少なくとも 1 つの子条件を指定する必要があります。

継承階層

System.Object
   Microsoft.SqlServer.NotificationServices.Rules.RuleObject
     Microsoft.SqlServer.NotificationServices.Rules.Condition
       Microsoft.SqlServer.NotificationServices.Rules.ConditionTree
        Microsoft.SqlServer.NotificationServices.Rules.OrCondition

使用例

OrCondition オブジェクトを使用して Notification Services サブスクリプションの Condition を定義する例を次に示します。この条件は、2 つの SimpleLeafCondition オブジェクトで構成されています。どちらかの SimpleLeafCondition オブジェクトが true と評価される場合、OrConditiontrue です。

// 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 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

OrCondition Members
Microsoft.SqlServer.NotificationServices.Rules Namespace