public ConcreteMediator(LandlordComponent landlordComponent, TenantComponent tenantComponent) { this.landlordComponent = landlordComponent; this.landlordComponent.SetMediator(this); this.tenantComponent = tenantComponent; this.tenantComponent.SetMediator(this); }
static void Main(string[] args) { LandlordComponent landlordComponent = new LandlordComponent(); TenantComponent tenantComponent = new TenantComponent(); new ConcreteMediator(landlordComponent, tenantComponent); landlordComponent.DoA(); Console.WriteLine(); tenantComponent.DoC(); Console.ReadKey(); }