Attachments class methods

AddAttachment method

Lets users select a file that is then added as an attachment.

Syntax

public void AddAttachment()

Remarks

The method opens an OpenFileDialog dialog to let users select a file to add; therefore the method can only be called from within an event handler method, e.g. a handler for Button’s event Click.

 

AddAttachment(FileInfo) method

Adds a file described by the supplied FileInfo structure as an attachment.

Syntax

public void AddAttachment(FileInfo file)

Parameters

file

Type:     System.IO.FileInfo

The information about a file to be added as an attachment. The file can for example be obtained by using OpenFileDialog class.

 

GetAttachments method

Returns information about all attachments.

Syntax

public AttachmentInfo[] GetAttachments()

Return value

Type:    AttachmentInfo[]

An array of AttachmentInfo objects, one for each attached file.

 

RemoveAttachment(Guid) method

Removes an attachment by its unique identifier.

Syntax

public void RemoveAttachment(Guid uid)

Parameters

uid

Type:  System.Guid

The unique identifier of the attachment to be removed.