Partager via


ContentFormatter.ContentFormatterArguments Property

Gets the collection of initialization arguments for the content formatter.

Espace de noms: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntaxe

'Déclaration
Public ReadOnly Property ContentFormatterArguments As ContentFormatterArgumentCollection
public ContentFormatterArgumentCollection ContentFormatterArguments { get; }
public:
property ContentFormatterArgumentCollection^ ContentFormatterArguments {
    ContentFormatterArgumentCollection^ get ();
}
/** @property */
public ContentFormatterArgumentCollection get_ContentFormatterArguments ()
public function get ContentFormatterArguments () : ContentFormatterArgumentCollection

Valeur de propriété

A ContentFormatterArgumentCollection object containing the arguments for the content formatter.

Notes

The distributor passes these arguments to the content formatter's Initialize method.

Exemple

The following examples show how to create and define a content formatter object for the built-in XSLT content formatter. The content formatter has arguments that are added using this property:

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

Sécurité des threads

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.

Plateformes

Plateformes de développement

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Plateformes cibles

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Voir aussi

Référence

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

Autres ressources

Configuration des modules de formatage de contenu
Arguments Element for ContentFormatter (ADF)