private void btnSwap_Click(object sender, EventArgs e) { Elephant swap = lloyd; lloyd = lucinda; lucinda = swap; swap = null; }
private void button1_Click(object sender, EventArgs e) { lloyd.TellMe("Hi", lucinda); lloyd.SpeakTo(lucinda, "Hello"); lloyd = lucinda; lloyd.EarSize = 4321; lloyd.WhoAmI(); }
public void TellMe(string message, Elephant whoSaidIt) { MessageBox.Show(whoSaidIt.Name + " says: " + message); }
public void SpeakTo(Elephant whoToTalkTo, string message) { whoToTalkTo.TellMe(message, this); }
private void button1_Click(object sender, EventArgs e) { Lloyd = Lucinda; Lloyd.EarSize = 4321; Lloyd.WhoAmI(); }