다음을 통해 공유


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