delegates/3/Messenger.cs - A Messenger class and a Message delegate. | Lecture 6 - slide 8 : 20 Program 1 |
using System; public delegate void Message(string txt); public class Messenger{ private string sender; private Message message; public Messenger(string sender){ this.sender = sender; message = null; } public Messenger(string sender, Message aMessage){ this.sender = sender; message = aMessage; } public void DoSend(){ message("Message from " + sender); } }