/// <summary> /// 观察者演绎 /// </summary> public void ObserverDeduceInit() { //实例化订阅者和订阅号对象 Subscriber learningHardSub = new Subscriber("LearningHard"); TenxunGame txGame = new TenxunGame(); txGame.Subscriber = learningHardSub; txGame.Symbol = "TenXun Game"; txGame.Info = "Have a new game published ...."; txGame.Update(); }
public void ReceiveAndPrintData(TenxunGame txGame) { Console.WriteLine("Notified {0} of {1}'s" + " Info is: {2}", Name, txGame.Symbol, txGame.Info); }