Share via


ProtocolDefinition Constructor ()

Initializes a new instance of the ProtocolDefinition class.

Namespace: Microsoft.SqlServer.Management.Nmo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntax

'Declaration
Public Sub New
public ProtocolDefinition ()
public:
ProtocolDefinition ()
public ProtocolDefinition ()
public function ProtocolDefinition ()

Remarks

Updated text:5 December 2005

Updated sample code:5 December 2005

If you use the default constructor, you must immediately set the Name property and then set the Parent property. You can then set the ClassName and AssemblyName properties.

Example

The following examples show how to use this default constructor to define a custom delivery protocol for an instance of Notification Services:

// Define a custom delivery protocol and set required properties.
ProtocolDefinition customProtocol = new ProtocolDefinition();
customProtocol.Name = "MyCustomProtocol";
customProtocol.Parent = myInstance;
customProtocol.ClassName = "MyNamespace.MyProtocolClass";
customProtocol.AssemblyName = @"C:\NS\Default\MyCustomComponents.dll";
myInstance.ProtocolDefinitions.Add(customProtocol);
' Define a custom delivery protocol and set required properties.
Dim customProtocol As ProtocolDefinition = _
    New ProtocolDefinition()
customProtocol.Name = "MyCustomProtocol"
customProtocol.Parent = myInstance
customProtocol.ClassName = "MyNamespace.MyProtocolClass"
customProtocol.AssemblyName = "C:\NS\Default\MyCustomComponents.dll"
myInstance.ProtocolDefinitions.Add(customProtocol)

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

See Also

Reference

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