private void button3_Click(object sender, EventArgs e) { Elephant holder; holder = lloyd; lloyd = lucinda; lucinda = holder; MessageBox.Show("Objects swapped"); }
public void Speakto(Elephant whoToTalkTo, string message) { whoToTalkTo.TellMe(message, this); }
public void TellMe(string message, Elephant whoSaidIt) { MessageBox.Show(whoSaidIt.Name + " says: " + message); }
public void SpeakTo(Elephant whoToTalkTo, string strMessage) { whoToTalkTo.TellMe(strMessage, this); }
private void button4_Click(object sender, EventArgs e) { lloyd = lucinda; lloyd.IntEarSize = 4321; lloyd.WhoAmI(); }
private void button4_Click(object sender, EventArgs e) { lloyd = lucinda; lloyd.EarSize = 4321; lloyd.WhoAmI(); }
public Form1() { InitializeComponent(); lucinda = new Elephant() { Name = "Lucinda", EarSize = 33 }; lloyd = new Elephant() { Name = "Lloyd", EarSize = 40 }; }