CSDN博客

img 2002pine

Design Pattern 11-Adapter

发表于2004/9/29 14:22:00  768人阅读

using System;

namespace Pattern
{
 /// <summary>
 /// Summary description for Class1.
 /// </summary>
 public class adapter:Circle,draw
 {
  public adapter()
  {
   //
   // TODO: Add constructor logic here
   //
  }
  public void drawEqual()
  {
   System.Console.WriteLine("draw equal");
  }
 
 }
 public class Circle
 {
  public Circle()
  {
  }
  public void drawCircle()
  {
   System.Console.WriteLine("draw circle");
  }
 }
 public interface draw
 {
  void drawCircle();
  void drawEqual();
 }

}

   //适配器模式
//   adapter a=new adapter();
//   a.drawCircle();
//   a.drawEqual();

阅读全文
0 0

相关文章推荐

img
取 消
img