Class LocalMailFolderTree
- Namespace
- MailFathom.Domain.Folders
- Assembly
- MailFathom.Domain.dll
The live folders of one held account, and the rules every act on them is decided by.
public sealed class LocalMailFolderTree
- Inheritance
-
LocalMailFolderTree
- Inherited Members
Remarks
Every held account has an inbox, a drafts folder, a sent folder, a junk folder, and a trash folder, and none of the five can be renamed, moved, or deleted, because composing, sending, classifying, and deleting each need somewhere to go that no earlier act can have taken away. Deleting any other folder moves it, with everything beneath it, into the trash; deleting a folder already in the trash erases it. See ADR 0034.
The tree decides and never writes. What an act changes comes back as a LocalMailFolderEdit, so the whole of a decision is testable without a store and a store applies what was decided rather than deciding again.
Constructors
- LocalMailFolderTree(IEnumerable<LocalMailFolder>, IEnumerable<MailFolderAlias>)
Initializes a new instance of the LocalMailFolderTree class.
Fields
- MaximumDepth
The deepest level a folder may sit at, the top of the hierarchy being level one.
- MaximumFolders
The most live folders one account's hierarchy holds.
Properties
- Folders
Gets the live folders.
- ProtectedRoles
Gets the roles every held account has a folder for.
Methods
- Create(LocalMailFolderId, LocalMailFolderId?, string?)
Decides creating a folder.
- Delete(LocalMailFolderId)
Decides deleting a folder: into the trash, or out of existence where it is already there.
- Find(LocalMailFolderId)
Finds a live folder.
- IsInTrash(LocalMailFolderId)
Gets whether a folder is the trash or sits anywhere beneath it, which is what makes deleting it an erasure.
- MissingProtectedFolders(Func<LocalMailFolderId>)
States the protected folders the account lacks.
- Move(LocalMailFolderId, LocalMailFolderId?)
Decides moving a folder, with everything beneath it, to another place in the hierarchy.
- PlaceArrival(MailFolderAlias, MailFolderSpecialUse?, string?, Func<LocalMailFolderId>)
Decides where a message arriving from a source folder goes.
- Rename(LocalMailFolderId, string?)
Decides renaming a folder.
- With(IReadOnlyCollection<LocalMailFolder>)
Returns the tree with the given folders written over it.