示例#1
0
        static void Main(string[] args)
        {
            Interface.IController controller = new Controller.Index() as Interface.IController;
            controller.DoApplication();

            Console.ReadKey();
        }
示例#2
0
        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;
            }
        }