Delen via


IAttachmentOwner.CreateAttachment Method (String, SourceFileAction)

Creates an attachment from a file, optionally deleting the source file after uploading.

Namespace:  Microsoft.TeamFoundation.TestManagement.Client
Assembly:  Microsoft.TeamFoundation.TestManagement.Client (in Microsoft.TeamFoundation.TestManagement.Client.dll)

Syntax

'Declaration
Function CreateAttachment ( _
    sourceFileName As String, _
    deleteOnCompletion As SourceFileAction _
) As ITestAttachment
ITestAttachment CreateAttachment(
    string sourceFileName,
    SourceFileAction deleteOnCompletion
)
ITestAttachment^ CreateAttachment(
    String^ sourceFileName, 
    SourceFileAction deleteOnCompletion
)
abstract CreateAttachment : 
        sourceFileName:string * 
        deleteOnCompletion:SourceFileAction -> ITestAttachment
function CreateAttachment(
    sourceFileName : String, 
    deleteOnCompletion : SourceFileAction
) : ITestAttachment

Parameters

  • sourceFileName
    Type: String

    The fully qualified file name for the file to attach.

Return Value

Type: Microsoft.TeamFoundation.TestManagement.Client.ITestAttachment
The new attachment.

Remarks

When the object is added and saved, the specified file will be uploaded to the server or queued for upload. It must continue to be readable until the upload is completed. The attachment is added to the server by calling the Add method.

.NET Framework Security

See Also

Reference

IAttachmentOwner Interface

CreateAttachment Overload

Microsoft.TeamFoundation.TestManagement.Client Namespace

ITestAttachment