static void Main(string[] args) { Interface.IController controller = new Controller.Index() as Interface.IController; controller.DoApplication(); Console.ReadKey(); }
public Interface.IController FactoryController(Model.Cache Cache) { switch (Cache.getControllerInCache()) { case Model.Cache.controller.Boat: CurrentController = new Boat() as Interface.IController; // "Moving" cache to new controller Important! CurrentController.Cache = Cache; return CurrentController; case Model.Cache.controller.Index : CurrentController = new Index() as Interface.IController; // "Moving" cache to new controller Important! CurrentController.Cache = Cache; return CurrentController; case Model.Cache.controller.Member: CurrentController = new Member() as Interface.IController; // "Moving" cache to new controller Important! CurrentController.Cache = Cache; return CurrentController; case Model.Cache.controller.Stateless: throw new NotImplementedException(); //CurrentController = new Stateless() as Interface.IController; //return CurrentController; default: return null; } }