# EmailAttachmentPatch

Ordered, bounds-checked changes to an email attachment collection.

Class 

`OfficeIMO.Email`

**Namespace**

`OfficeIMO.Email`

**Assembly**

`OfficeIMO.Email`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[EmailAttachmentPatch.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Model/EmailAttachmentPatch.cs#L31)

**Modifiers**

sealed

Ordered, bounds-checked changes to an email attachment collection.

## Inheritance

- object
- EmailAttachmentPatch

## Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 4

- Method [EmailAttachmentPatch.Add](/api/email/officeimo-email-emailattachmentpatch/#method-add-officeimo-email-emailattachment)
- Method [EmailAttachmentPatch.RemoveAt](/api/email/officeimo-email-emailattachmentpatch/#method-removeat-int32)
- Method [EmailAttachmentPatch.ReplaceAt](/api/email/officeimo-email-emailattachmentpatch/#method-replaceat-int32-officeimo-email-emailattachment)
- Property [EmailStoreItemPatch.Attachments](/api/email/officeimo-email-store-emailstoreitempatch/#property-attachments)

### Accepted by parameters 2

- Method [EmailStoreItemPatch.PatchAttachments](/api/email/officeimo-email-store-emailstoreitempatch/#method-patchattachments-officeimo-email-emailattachmentpatch) parameter `patch`
- Method [EmailStorePstMutationTransaction.PatchItemAttachments](/api/email/officeimo-email-store-emailstorepstmutationtransaction/#method-patchitemattachments-string-officeimo-email-emailattachmentpatch-threading-cancellationtoken) parameter `patch`

Filter members 

Show inherited

## Constructors

`public EmailAttachmentPatch()` [#](#constructor-ctor)

[EmailAttachmentPatch.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Model/EmailAttachmentPatch.cs#L31)

## Methods

`public EmailAttachmentPatch Add(EmailAttachment attachment)` [#](#method-add-officeimo-email-emailattachment)

[EmailAttachmentPatch.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Model/EmailAttachmentPatch.cs#L39)

Stages an attachment append.

Parameters

**attachment OfficeIMO.Email.EmailAttachment required**

Returns

`EmailAttachmentPatch`

`public void Apply(IList<EmailAttachment> attachments)` [#](#method-apply-collections-generic-ilist-officeimo-email-emailattachment)

[EmailAttachmentPatch.cs:85](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Model/EmailAttachmentPatch.cs#L85)

Applies all operations only after the complete ordered patch has passed validation.

Parameters

**attachments System.Collections.Generic.IList<OfficeIMO.Email.EmailAttachment> required**

`public EmailAttachmentPatch RemoveAt(int index)` [#](#method-removeat-int32)

[EmailAttachmentPatch.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Model/EmailAttachmentPatch.cs#L46)

Stages removal at the current zero-based index.

Parameters

**index int required**

Returns

`EmailAttachmentPatch`

`public EmailAttachmentPatch ReplaceAt(int index, EmailAttachment attachment)` [#](#method-replaceat-int32-officeimo-email-emailattachment)

[EmailAttachmentPatch.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Model/EmailAttachmentPatch.cs#L53)

Stages replacement at the current zero-based index.

Parameters

**index int required**

**attachment OfficeIMO.Email.EmailAttachment required**

Returns

`EmailAttachmentPatch`

`public void Validate(IList<EmailAttachment> attachments)` [#](#method-validate-collections-generic-ilist-officeimo-email-emailattachment)

[EmailAttachmentPatch.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Model/EmailAttachmentPatch.cs#L61)

Validates every operation against the collection state produced by preceding operations.

Parameters

**attachments System.Collections.Generic.IList<OfficeIMO.Email.EmailAttachment> required**

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public IReadOnlyList<EmailAttachmentPatchChange> Changes { get; }` [#](#property-changes)

[EmailAttachmentPatch.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Model/EmailAttachmentPatch.cs#L33)

Ordered immutable view of staged operations.

`public bool IsEmpty { get; }` [#](#property-isempty)

[EmailAttachmentPatch.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Model/EmailAttachmentPatch.cs#L35)

Whether no attachment operation is staged.

<!-- PowerForge markdown artifact sha256:D5AF0A5B92D195CC36F4414183BAED22C2177556C410FF133FECE9558FDD0106 -->
