예제 #1
0
 private void button3_Click(object sender, EventArgs e)
 {
     Elephant tmp;
     tmp = lucinda;
     lucinda = lloyd;
     lloyd = tmp;
     MessageBox.Show("Objects swapped");
 }
예제 #2
0
 public void TellMe(string message, Elephant whoSaidIt)
 {
     MessageBox.Show(whoSaidIt.Name + " says: " + message);
 }
예제 #3
0
 public void SpeakTo(Elephant whoTOTalkTo, string message)
 {
     whoTOTalkTo.TellMe(message, this);
 }
예제 #4
0
 public void SpeakTo(Elephant whoTOTalkTo, string message)
 {
     whoTOTalkTo.TellMe(message, this);
 }
예제 #5
0
 public void TellMe(string message, Elephant whoSaidIt)
 {
     MessageBox.Show(whoSaidIt.Name + " says: " + message);
 }
예제 #6
0
 public Form1()
 {
     InitializeComponent();
     lucinda = new Elephant() { Name = "Lucinda", EarSize = 33 };
     lloyd = new Elephant() { Name = "Lloyd", EarSize = 40 };
 }