Ejemplo n.º 1
0
 public MessageEventArgs(Agent Destination, Message newMessage)
 {
     destination = Destination;
       message = newMessage;
 }
Ejemplo n.º 2
0
 public BroadcastMessageEventArgs(Message newMessage)
 {
     message = newMessage;
 }
Ejemplo n.º 3
0
 public void Broadcast(Message aMessage)
 {
     BroadcastEvent(this, new BroadcastMessageEventArgs(aMessage));
 }
Ejemplo n.º 4
0
 public void SendPost(Agent destination, ref Message aMessage)
 {
     // Check if the post box exists
       if (postbox.ContainsKey(destination)) {
     // Post box exists place post into the box
     // postbox[destination].Enqueue(aMessage);
     MessageEvent(this, new MessageEventArgs(destination, aMessage));
       } else {
     // Throw exception indicating that the post box is not valid
     throw new Exception("No post box exists for that destination");
       }
 }
Ejemplo n.º 5
0
 void messageQueue_MessageEvent(object sender, MessageEventArgs e)
 {
     if (e.Destination.Equals(this)) {
     post = e.MailMessage;
     HandlePost();
       }
 }