示例#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 };
 }