Example #1
0
 public MessageEventArgs(Agent Destination, Message newMessage)
 {
     destination = Destination;
       message = newMessage;
 }
Example #2
0
 public BroadcastMessageEventArgs(Message newMessage)
 {
     message = newMessage;
 }
Example #3
0
 public void Broadcast(Message aMessage)
 {
     BroadcastEvent(this, new BroadcastMessageEventArgs(aMessage));
 }
Example #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");
       }
 }
Example #5
0
 void messageQueue_MessageEvent(object sender, MessageEventArgs e)
 {
     if (e.Destination.Equals(this)) {
     post = e.MailMessage;
     HandlePost();
       }
 }