DesignPattern_Structural_Adapter

void Main()
{
    Target t = new Adapter();
    t.TargetShow();
}

class Target{
    public virtual void TargetShow(){}
}
class Adapter:Target{
    Subject subject = new Subject();
    public override void TargetShow(){
        subject.SubjectShow();
    }
}
class Subject{
    public void SubjectShow(){}
}
时间: 2024-11-06 12:48:40

DesignPattern_Structural_Adapter的相关文章