/// <summary> /// Издатель-подписчик (поведенческий) /// </summary> static void Observer() { DriveSport mag = new DriveSport(); Person p = new Person(mag); mag.Notify(); }
public Person(DriveSport driveSport) { this.driveSport = driveSport; driveSport.Subscribe(this); }