示例#1
0
文件: Form1.cs 项目: saians/MyEnd
 private void button3_Click(object sender, EventArgs e)
 {
     Elephant holder;
     holder = llyod;
     llyod = lucinda;
     lucinda = holder;
     MessageBox.Show("Objects swapped..");
 }
示例#2
0
文件: Form1.cs 项目: saians/MyEnd
 private void button4_Click(object sender, EventArgs e)
 {
     llyod.TellMe("hi", lucinda);
     llyod.SpeakTo(lucinda,"its me llyod");
     llyod = lucinda;
     llyod.EarSize = 2212;
     llyod.WhoAmI();
 }
示例#3
0
文件: Elephant.cs 项目: saians/MyEnd
 public void TellMe(string message, Elephant whoSaidIt)
 {
     MessageBox.Show(whoSaidIt.Name + " says: " + message);
 }
示例#4
0
文件: Elephant.cs 项目: saians/MyEnd
 /// <summary>
 /// 
 /// </summary>
 /// <param name="whoToTalkTo">With whom this elephant is talking with</param>
 /// <param name="message">the message to be conveyed</param>
 public void SpeakTo(Elephant whoToTalkTo, string message)
 {
     whoToTalkTo.TellMe(message,this);
 }
示例#5
0
文件: Form1.cs 项目: saians/MyEnd
 public Form1()
 {
     InitializeComponent();
      lucinda = new Elephant() { Name = "Lucinda", EarSize = 33 };
      llyod = new Elephant() { EarSize = 44, Name = "Llyod" };
 }