Beispiel #1
0
        static void Main(string[] args)
        {
            //testAny1();
            Framework framework = new Framework();

            framework.setLogger(new ConsoleLogger());

            framework.Initialize();

            framework.getStaticPipe().RegisterModel("SimpleModel", new SimpleModel());
            SimpleView simpleView = new SimpleView();

            framework.getStaticPipe().RegisterView("SimpleView", simpleView);
            framework.getStaticPipe().RegisterController("SimpleController", new SimpleController());
            SimpleService service = new SimpleService();

            service.useMock       = true;
            service.MockProcessor = SimpleMock.MockProcessor;
            framework.getStaticPipe().RegisterService("SimpleService", service);

            framework.Setup();

            // 主循环
            // 模拟登录按钮被点击时
            {
                simpleView.OnSigninClicked();
            }

            framework.Dismantle();
            framework.getStaticPipe().CancelService("SimpleService");
            framework.getStaticPipe().CancelController("SimpleController");
            framework.getStaticPipe().CancelView("SimpleView");
            framework.getStaticPipe().CancelModel("SimpleModel");

            framework.Release();
        }
Beispiel #2
0
 protected override void preSetup()
 {
     service = findService("SimpleService") as SimpleService;
 }