Exemple #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     lloyd.TellMe("Hi", lucinda);
     lloyd = lucinda;
     lloyd.EarSize = 4321;
     lloyd.whoAmI();
 }
Exemple #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     Elephant temp = new Elephant();
     temp = lucinda;
     lucinda = lloyd;
     lloyd = temp;
     MessageBox.Show("Objects Swapped.");
 }
Exemple #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;
     }
 }
Exemple #4
0
 public void SpeakTo(Elephant whoToTalkTo, string message)
 {
     whoToTalkTo.TellMe(message, this);
 }
Exemple #5
0
 public void TellMe(string message, Elephant whoSaidIt)
 {
     MessageBox.Show(whoSaidIt.Name + " says: " + message);
 }
Exemple #6
0
 public void TellMe(string message, Elephant whoSaidIt)
 {
     MessageBox.Show($@"{whoSaidIt.Name} says {message}");
 }
Exemple #7
0
 public void TellMe(string message, Elephant whoSaidIt)
 {
     MessageBox.Show(whoSaidIt.Name + " says: " + message);
 }
Exemple #8
0
 public void SpeakTo(Elephant whoToTalkTo, string message)
 {
     whoToTalkTo.TellMe(message, this);
 }
Exemple #9
0
 public Form1()
 {
     InitializeComponent();
     lucinda = new Elephant() { Name = "Lucinda", EarSize = 33 };
     lloyd = new Elephant() { Name = "Lloyd", EarSize = 40 };
 }