다음을 통해 공유


NotificationClass.ContentFormatter Property

Gets or sets content formatter used by the notification class.

네임스페이스: Microsoft.SqlServer.Management.Nmo
어셈블리: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

구문

‘선언
Public Property ContentFormatter As ContentFormatter
public ContentFormatter ContentFormatter { get; set; }
public:
property ContentFormatter^ ContentFormatter {
    ContentFormatter^ get ();
    void set (ContentFormatter^ value);
}
/** @property */
public ContentFormatter get_ContentFormatter ()

/** @property */
public void set_ContentFormatter (ContentFormatter value)
public function get ContentFormatter () : ContentFormatter

public function set ContentFormatter (value : ContentFormatter)

속성 값

A ContentFormatter object representing the content formatter for the notification class.

주의

Each notification class has one content formatter. The content formatter can perform different formatting based on notification field values.

The built-in Extensible Stylesheet Language Transform (XSLT) content formatter can use different XSLT files based on the notification's subscriber device and locale. For more information about the standard XSLT content formatter, see XSLT 콘텐츠 포맷터.

The following examples show how to define an XSLT content formatter and add it to a notification class:

// Add the XSLT content formatter to the notification class
ContentFormatter contentFormatter = 
    new ContentFormatter(flightNotifications, "XsltFormatter");

// Define content formatter arguments
ContentFormatterArgument contentFormatterArgument1 = 
    new ContentFormatterArgument(
    contentFormatter, "XsltBaseDirectoryPath");
contentFormatterArgument1.Value = @"C:\NS\Full\XSLFiles";
ContentFormatterArgument contentFormatterArgument2 = 
    new ContentFormatterArgument(contentFormatter, "XsltFileName");
contentFormatterArgument2.Value = "NoOp.xslt";

// Add arguments to content formatter
contentFormatter.ContentFormatterArguments.Add(
    contentFormatterArgument1);
contentFormatter.ContentFormatterArguments.Add(
    contentFormatterArgument2);

// Assign the content formatter to the notification class
flightNotifications.ContentFormatter = contentFormatter;
' Add the XSLT content formatter to the notification class
Dim contentFormatter As ContentFormatter = _
    New ContentFormatter(flightNotifications, "XsltFormatter")

' Define content formatter arguments
Dim contentFormatterArgument1 As ContentFormatterArgument = _
    New ContentFormatterArgument(contentFormatter, _
    "XsltBaseDirectoryPath")
contentFormatterArgument1.Value = "C:\NS\Full\XSLFiles"
Dim contentFormatterArgument2 As ContentFormatterArgument = _
    New ContentFormatterArgument(contentFormatter, _
    "XsltFileName")
contentFormatterArgument2.Value = "NoOp.xslt"

' Add arguments to content formatter
contentFormatter.ContentFormatterArguments.Add( _
    contentFormatterArgument1)
contentFormatter.ContentFormatterArguments.Add( _
    contentFormatterArgument2)

' Assign the content formatter to the notification class
flightNotifications.ContentFormatter = contentFormatter

스레드 보안

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 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

NotificationClass Class
NotificationClass Members
Microsoft.SqlServer.Management.Nmo Namespace

관련 자료

알림 클래스 정의
콘텐츠 포맷터 구성
ContentFormatter Element (ADF)