Exemplo n.º 1
0
 private void MessageArrived(Object source, MessageArrivedEventArgs eventArgs)
 {
     foreach(Object connection in connections)
     {
         if(connection != source)
         {
             continue;
         }
         // TODO: delegate
     }
 }
Exemplo n.º 2
0
 public void CantBeNull()
 {
     try
     {
         MessageArrivedEventArgs eventArgs = new MessageArrivedEventArgs(null);
         Assert.Fail("Constructor Parameter can't be null");
     }
     catch(ArgumentNullException exception)
     {
         Assert.AreEqual("message", exception.ParamName, "message param is null");
     }
     catch
     {
         Assert.Fail("Invalid exception thrown");
     }
 }
Exemplo n.º 3
0
 public void GetMessage()
 {
     MessageArrivedEventArgs eventArgs = new MessageArrivedEventArgs("Hello, World");
     Assert.AreEqual("Hello, World", eventArgs.Message);
 }
Exemplo n.º 4
0
 private void ReceiveMessage_MessageArrived(Object source, MessageArrivedEventArgs eventArgs)
 {
     lock(this)
     {
         this.eventArgs = eventArgs;
         Monitor.Pulse(this);
     }
 }
Exemplo n.º 5
0
 private void MessageArrivedEvent_MessageArrived(Object source, MessageArrivedEventArgs eventArgs)
 {
 }
Exemplo n.º 6
0
 protected virtual void OnMessageArrived(MessageArrivedEventArgs eventArgs)
 {
     if(null != MessageArrived)
     {
         MessageArrived(this, eventArgs);
     }
 }