public void FirstTimeAStringArrives(Actor sender, ActorMatch address, object message)
 {
     // 4. reconfigure this actor to have the SecondTimeAStringArrives function to respond when strings are sent.
     MessageBox.Show((string)message, @"First time");
     MatchList.Clear();
     MatchList.Add(new ActorMatch(typeof(string), SecondTimeAStringArrives));
 }
Example #2
0
 private void StringReceiver(Actor sender, ActorMatch address, object message)
 {
     MessageBox.Show($@"String receiver in {GetType().Name} got: {message}");
 }
 public void SecondTimeAStringArrives(Actor sender, ActorMatch address, object message)
 {
     MessageBox.Show((string)message, @"Second time");
 }
 public void I_accept_ints(Actor sender, ActorMatch address, object message) =>
 MessageBox.Show(((int)message).ToString(), @"Got an int");
 // 5. Accept different types of messages.
 public void I_accept_strings(Actor sender, ActorMatch address, object message) =>
 MessageBox.Show((string)message, @"Got a string");
 public void MyReceiver(Actor sender, ActorMatch address, object message)
 {
     MessageBox.Show($@"Found instance with value {Value}, got message: {message}");
 }