public void Request() { // Possibly do some other work and then call SpecificRequest Adaptee adaptee = new Adaptee(); adaptee.SpecificRequest(); }
public override void Request() { // Possibly do some other work // and then call SpecificRequest adaptee.SpecificRequest(); adaptee.SpecificRequest2(); }
static void Main(string[] args) { // Showing the Adapteee in standalone mode Adaptee first = new Adaptee(); Console.Write("Before the new standard\nPrecise reading: "); Console.WriteLine(first.SpecificRequest(5, 3)); // What the client really wants ITarget second = new Adapter(); Console.WriteLine("\nMoving to the new standard"); Console.WriteLine(second.Request(5)); }
static void Main(string[] args) { var first = new Adaptee(); Console.Write("Before the new standard\nPrecise reading: "); Console.WriteLine(first.SpecificRequest(5, 3)); ITarget second = new Adapter(); Console.WriteLine("\nMoving to the new standard"); Console.WriteLine(second.Request(5)); Console.ReadLine(); }
private static void Main() { //adaptee in standalone mode var adaptee = new Adaptee(); Console.WriteLine("Before the new standard\nPrecise reading: "); Console.WriteLine(adaptee.SpecificRequest(5, 3)); //What the client really wants ITarget adapter = new Adapter(); Console.WriteLine("\nMoving to the new standard"); Console.WriteLine(adapter.Request(5)); }
public void Request() { adaptee.SpecificRequest(); }
public void Request() { adaptee.SpecificRequest(); Console.Write("\n\\n using Adapter.Request()\n"); }
public override void Request() { _adaptee.SpecificRequest(); }
// delegação simples repassa a chamada ao adaptee public override string Request() { // chamada de método de interface diferente return(_adaptee.SpecificRequest()); }
public override void Request() { Console.WriteLine("Adapter.Request()"); Console.WriteLine("Redirecting Requet To the Adaptee..."); adaptee.SpecificRequest(); }
// delegação simples repassa a chamada ao adaptee public override void Request() { // chamada de método de interface diferente _adaptee.SpecificRequest(); }