ViewInputType Class
Describes a View object that can be used as an input to a RuleObject instance. This class cannot be inherited.
命名空間: Microsoft.SqlServer.NotificationServices.Rules
組件: Microsoft.SqlServer.NotificationServices.Rules (in microsoft.sqlserver.notificationservices.rules.dll)
語法
'宣告
Public Class ViewInputType
Inherits InputType
public class ViewInputType : InputType
public ref class ViewInputType : public InputType
public class ViewInputType extends InputType
public class ViewInputType extends InputType
備註
You must set the View property using the property or the ViewInputType(View) constructor.
Inheritance Hierarchy
System.Object
Microsoft.SqlServer.NotificationServices.Rules.RuleObject
Microsoft.SqlServer.NotificationServices.Rules.InputType
Microsoft.SqlServer.NotificationServices.Rules.ViewInputType
範例
The following example shows how to specify a view (specifically, an event view) as the InputType for a PropertyRule object:
// 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();
執行緒安全性
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.
平台
開發平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
目標平台
如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。
請參閱
參考
ViewInputType Members
Microsoft.SqlServer.NotificationServices.Rules Namespace