C#策略模式
//策略模式:
/*
* 1.定义接口
* 2.接口实现方法(class 方法名 :接口),里面可以有多个方法
* 3.使用方法 class 方法名{ public 方法名(接口名1 定义接口名1, 接口名2 定义接口名2, 接口名2 定义接口名3)
* {this.GetMisplay = GetMisplay;
* this.GetSvin = GetSvin;
* this.GetFay = GetFay;
*
* IMisplay GetMisplay;
* ISvin GetSvin;
* IFay GetFay;
*
* public void Misplay()//方法1
* {
* GetMisplay.Misplay();
* GetMisplay.Misplay2();
* }
* public void Svin()//方法2
* {
* GetSvin.Svin();
* }
*
* public void Fay()//方法3
* {
* GetFay.Fay();
* }
* }}
*
* 4.程序中使用接口的方法
* Dock dock = new Dock(new 要使用的方法(对接接口)1,new 要使用的方法(对接接口)2,new 要使用的方法(对接接口)3);
* dock.Misplay();
* dock.Svin();
* dock.Fay();
*
*/