Example #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     lloyd.TellMe("Hi", lucinda);
     lloyd = lucinda;
     lloyd.EarSize = 4321;
     lloyd.whoAmI();
 }
Example #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     Elephant temp = new Elephant();
     temp = lucinda;
     lucinda = lloyd;
     lloyd = temp;
     MessageBox.Show("Objects Swapped.");
 }
Example #3
0
 private void Swap_Click(object sender, EventArgs e)
 {
     //Elephant holder;
     //holder = lloyd;
     //lloyd = lucinda;
     //lucinda = holder;
     if (elephantSaver == null)
     {
         elephantSaver = lucinda;
         lucinda       = lloyd;
         lloyd         = elephantSaver;
     }
     else
     {
         lloyd   = lucinda;
         lucinda = lloyd;
         lucinda = elephantSaver;
     }
 }
Example #4
0
 public void SpeakTo(Elephant whoToTalkTo, string message)
 {
     whoToTalkTo.TellMe(message, this);
 }
Example #5
0
 public void TellMe(string message, Elephant whoSaidIt)
 {
     MessageBox.Show(whoSaidIt.Name + " says: " + message);
 }
Example #6
0
 public void TellMe(string message, Elephant whoSaidIt)
 {
     MessageBox.Show($@"{whoSaidIt.Name} says {message}");
 }
Example #7
0
 public void TellMe(string message, Elephant whoSaidIt)
 {
     MessageBox.Show(whoSaidIt.Name + " says: " + message);
 }
Example #8
0
 public void SpeakTo(Elephant whoToTalkTo, string message)
 {
     whoToTalkTo.TellMe(message, this);
 }
Example #9
0
 public Form1()
 {
     InitializeComponent();
     lucinda = new Elephant() { Name = "Lucinda", EarSize = 33 };
     lloyd = new Elephant() { Name = "Lloyd", EarSize = 40 };
 }