Пример #1
0
        //Constructor
        public PushForm(WeatherDataSubject subject)
        {
            InitializeComponent();

            //Store the subject.
            this.subject = subject;

            //subscribe this object to subject.
            subject.Attach(this);
        }
Пример #2
0
 //Constructor
 public CurrentConditionDisplayPushObserver(WeatherDataSubject dataSubject)
 {
     this.dataSubject = dataSubject;
     dataSubject.Attach(this);
 }