IContentFormatter.FormatContent Method
Activates the content formatter to format notification data.
命名空间: Microsoft.SqlServer.NotificationServices
程序集: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
语法
声明
Function FormatContent ( _
subscriberLocale As String, _
deviceTypeName As String, _
recipientInfo As RecipientInfo, _
rawContent As Hashtable() _
) As String
string FormatContent (
string subscriberLocale,
string deviceTypeName,
RecipientInfo recipientInfo,
Hashtable[] rawContent
)
String^ FormatContent (
String^ subscriberLocale,
String^ deviceTypeName,
RecipientInfo^ recipientInfo,
array<Hashtable^>^ rawContent
)
String FormatContent (
String subscriberLocale,
String deviceTypeName,
RecipientInfo recipientInfo,
Hashtable[] rawContent
)
function FormatContent (
subscriberLocale : String,
deviceTypeName : String,
recipientInfo : RecipientInfo,
rawContent : Hashtable[]
) : String
参数
- subscriberLocale
A String which can be used to determine how the notification is formatted with regards to language, date/time/currency formatting, and so on. For more information about these codes, see Subscriber Locale Codes.
- deviceTypeName
A String providing the name that identifies the type of target device for this notification. The value of this string is specified in the subscriber device record of the target device for the notification. You can make use of this information in your content formatter processing, to format the notification to display appropriately on the recipient device.
- recipientInfo
A RecipientInfo object containing information about the subscriber who is to receive the notification. This information is composed of a subscriber ID and a device address.
- rawContent
An array of Hashtable objects containing the raw notification data. Each hash table represents a single notification, with entries for each notification and computed field. The array contains only one Hashtable object, unless digest delivery is used. If that is the case, there is one Hashtable object for each notification in the digest group.
备注
The distributor uses this method to pass raw notification data to the content formatter and have it generate formatted content. Your implementation of the FormatContent method should transform the raw data passed by the distributor into an appropriate formatted message for your application and return the formatted message as a string.
Your custom content formatter can internally use any technique to produce the formatted string. A simple approach might use basic string manipulation; more complex approaches might use XSL transforms or Microsoft ASP.NET rendering.
The FormatContent method provides a good place to implement filtering or encoding of notification content for security purposes. For example, as a security precaution, you might want to limit the total size of the notification content string produced.
示例
For an example of how to implement the FormatContent method, see the IContentFormatter interface topic.
线程安全
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 的硬件和软件要求。
请参阅
参考
IContentFormatter Interface
IContentFormatter Members
Microsoft.SqlServer.NotificationServices Namespace