次の方法で共有


ContentFormatter Constructor

通知クラスと名前を使用して ContentFormatter オブジェクトを初期化します。

名前空間: Microsoft.SqlServer.Management.Nmo
アセンブリ: Microsoft.SqlServer.Smo (microsoft.sqlserver.smo.dll 内)

構文

'宣言
Public Sub New ( _
    ncParent As NotificationClass, _
    name As String _
)
public ContentFormatter (
    NotificationClass ncParent,
    string name
)
public:
ContentFormatter (
    NotificationClass^ ncParent, 
    String^ name
)
public ContentFormatter (
    NotificationClass ncParent, 
    String name
)
public function ContentFormatter (
    ncParent : NotificationClass, 
    name : String
)

パラメータ

  • ncParent
    このコンテンツ フォーマッタに対応する NotificationClass です。
  • name
    コンテンツ フォーマッタの論理名を示す String です。

    名前は変更できません。名前を変更するには、コンテンツ フォーマッタを削除してから、新しい名前を持つコンテンツ フォーマッタを追加する必要があります。

使用例

次の例は、組み込みの XSLT コンテンツ フォーマッタのコンテンツ フォーマッタ オブジェクトを作成して定義する方法を示しています。

// 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

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

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

その他の技術情報

コンテンツ フォーマッタの構成
ContentFormatter 要素 (ADF)