C# Class BinaryStudio.ClientManager.DomainModel.Input.MailMessagePersister

saves received messages into repository
Mostrar archivo Open project: titarenko/ClientManager Class Usage Examples

Public Methods

Method Description
Convert ( MailMessage mailMessage ) : Entities.MailMessage

Converts Input.MailMessage to Entities.MailMessage. If sender or receivers isn't exist then they will be added to repository If email forwarded then sender will be taken from body MailMessageParserThunderbird

MailMessagePersister ( IRepository repository, IEmailClient emailClient, IInquiryFactory inquiryFactory, IMailMessageParserFactory mailMessageParserFactory ) : System
ProcessMessage ( object sender, EventArgs args ) : void

Private Methods

Method Description
AddNewPersonToRepository ( System.Net.Mail.MailAddress mailOfPerson, System.DateTime dateOfIncomingMail ) : Person

Create new person in repository

createInquiry ( Entities convertedMessage ) : void
isForwardedMailMessage ( MailMessage mailMessage ) : bool

Returns true if mail message have fwd: or fw: in subject

Method Details

Convert() public method

Converts Input.MailMessage to Entities.MailMessage. If sender or receivers isn't exist then they will be added to repository If email forwarded then sender will be taken from body MailMessageParserThunderbird
public Convert ( MailMessage mailMessage ) : Entities.MailMessage
mailMessage MailMessage Input.MailMessage type of message
return Entities.MailMessage

MailMessagePersister() public method

public MailMessagePersister ( IRepository repository, IEmailClient emailClient, IInquiryFactory inquiryFactory, IMailMessageParserFactory mailMessageParserFactory ) : System
repository IRepository
emailClient IEmailClient
inquiryFactory IInquiryFactory
mailMessageParserFactory IMailMessageParserFactory
return System

ProcessMessage() public method

public ProcessMessage ( object sender, EventArgs args ) : void
sender object
args System.EventArgs
return void