|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CommunicationManager
{
public class MailCommunication:IMailCommunication, IMailCommunication2
{
#region Workflow to Host Communication
/// <summary>
/// Internal event to communicate with the host by events
/// </summary>
public event EventHandler<RequestMailEventArgs> SendInfoToHost;
/// <summary>
/// External Method that is called by the workflow.
/// </summary>
/// <param name="wfId"></param>
/// <param name="typo"></param>
/// <param name="orderNumber"></param>
public void GetEmailAddress(Guid wfId, string typo, string orderNumber)
{
//Create a Event to receive the info en host async.
RequestMailEventArgs args = new RequestMailEventArgs(wfId, typo, orderNumber);
if (SendInfoToHost != null)
{
SendInfoToHost(null, args);
}
}
//.. Send to host the information about the sended email...........
//public event EventHandler<NotificationEventArgs> ReceiveEmailNotification;
public void SendEmailNotification(Guid wfId, string notification)
{
Console.WriteLine(notification);
//........................
}
#endregion
#region Host To Workflow Communication
public event EventHandler<MailEventArgs> SendEmailToWorkflow;
/// <summary>
///
/// </summary>
/// <param name="instanceId"></param>
/// <param name="typo"></param>
/// <param name="email"></param>
public void RaiseSendEmailToWorkflow(Guid instanceId, string typo, string email)
{
//Raise the events
MailEventArgs args = new MailEventArgs(instanceId, typo, email);
if (SendEmailToWorkflow != null)
{
SendEmailToWorkflow(null, args);
}
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Jose A. Garcia Guirado, Electronic Engineer, graduated in Havana/Cuba 1982, MCTS, MCSD.NET, MCAD.NET, MCSE. Worked in the Institute for Cybernetics and Mathematics of Academy of Science of Cuba for 8 years; since 1995 working as free software architect, developer and adviser, first in Argentina and from 2003 to 2010, in Germany as External consultant in DWS Luxembourg, AIXTRON AG and Shell Deutschland GmbH and from 2010 to 2012 in Mexico working for Twenty Century Fox, and Mexico Stock Exchange (BMV). From 2013 to now in USA, Florida, First in FAME Inc. and now as Senior Software Engineer in Spirit Airlines.