首页 > 代码库 > DesignPattern_Structural_Bridge

DesignPattern_Structural_Bridge

void Main(){    Bridge bridge = new Bridge();    bridge.Set(new ShowA());    bridge.Show();    bridge.Set(new ShowB());    bridge.Show();}class Bridge{    IShow ishow;    public void Set(IShow isw){ishow=isw;}    public void Show(){        ishow.Show();    }}interface IShow{    void Show();}class ShowA:IShow{    public void Show(){}}class ShowB:IShow{    public void Show(){}}

 

DesignPattern_Structural_Bridge