See More

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Bridge { ///

/// Implementor which defines an interface for placing an order /// public interface IOrderingSystem { void Place(string order); } /// /// Abstraction which represents the sent order and maintains a reference to the restaurant where the order is going. /// public abstract class SendOrder { //Reference to the Implementor public IOrderingSystem _restaurant; public abstract void Send(); } /// /// Refined abstraction for a dairy-free order /// public class SendDairyFreeOrder : SendOrder { public override void Send() { _restaurant.Place("Dairy-Free Order"); } } /// /// Refined abstraction for a gluten free order /// public class SendGlutenFreeOrder : SendOrder { public override void Send() { _restaurant.Place("Gluten-Free Order"); } } /// /// Concrete implementor for an ordering system at a diner. /// public class DinerOrders : IOrderingSystem { public void Place(string order) { Console.WriteLine("Placing order for " + order + " at the Diner."); } } /// /// Concrete implementor for an ordering system at a fancy restaurant. /// public class FancyRestaurantOrders : IOrderingSystem { public void Place(string order) { Console.WriteLine("Placing order for " + order + " at the Fancy Restaurant."); } } }