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)); Console.Read(); }
public Adapter() { this.adaptee = new Adaptee(); }
public Adapter(Adaptee adaptee) { _adaptee = adaptee; }
public Adapter(Adaptee adaptee) { this._adaptee = adaptee; }
public ObjectAdapter(Adaptee adaptee) { _Adaptee = adaptee; }
public Adapter(Adaptee a) { adaptee = a; }
public ObjectAdapter(Adaptee adaptee) { this.m_adaptee = adaptee; }
private Adaptee adaptee;//维持一个对适配者对象的引用 public Adapter_(Adaptee adaptee) { this.adaptee = adaptee; }
public Twoway(Adaptee adaptee) { _Adaptee = adaptee; }
public Adapter() { adap = new Adaptee(); }
public ObjectAdapter() { _Adaptee = new Adaptee(); }