Embeds another copy of an existing attachment.
Namespace:
Gallio.Common.MarkupAssembly: Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)
Syntax
| C# |
|---|
public void EmbedExisting( string attachmentName ) |
| Visual Basic (Declaration) |
|---|
Public Sub EmbedExisting ( _ attachmentName As String _ ) |
Parameters
- attachmentName
- Type: System..::.String
The name of the existing attachment to embed.
Remarks
This method can be used to repeatedly embed an existing attachment at multiple points in multiple streams without needing to keep the Attachment instance itself around. This can help to reduce memory footprint since the original Attachment instance can be garbage collected shortly after it is first attached.
An attachment instance can be embedded multiple times efficiently since each embedded copy is typically represented as a link to the same common attachment instance.
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentNullException | Thrown if attachmentName is null. |
| System..::.InvalidOperationException | Thrown if no attachment with the specified name has been previously attached. |
