Partilhar via


SPContentType.AddWorkflowAssociation Method

NOTE: This API is now obsolete.

Use the WorkflowAssociations.Add method.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<ObsoleteAttribute("Use WorkflowAssociations.Add() instead")> _
Public Function AddWorkflowAssociation ( _
    workflowAssociation As SPWorkflowAssociation _
) As SPWorkflowAssociation
'Usage
Dim instance As SPContentType
Dim workflowAssociation As SPWorkflowAssociation
Dim returnValue As SPWorkflowAssociation

returnValue = instance.AddWorkflowAssociation(workflowAssociation)
[ObsoleteAttribute("Use WorkflowAssociations.Add() instead")]
public SPWorkflowAssociation AddWorkflowAssociation(
    SPWorkflowAssociation workflowAssociation
)

Parameters

Return Value

Type: Microsoft.SharePoint.Workflow.SPWorkflowAssociation
The workflow association.

Exceptions

Exception Condition
ArgumentException

The SPWorkflowAssociation object already exists in the collection, or it is based on an inappropriate workflow template.

ArgumentNullException

The SPWorkflowAssociation object is a null reference (Nothing in Visual Basic).

See Also

Reference

SPContentType Class

SPContentType Members

Microsoft.SharePoint Namespace

WorkflowAssociations