예제 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var controller = new ApplicationController(new AutofacAdapter())
                             .RegisterPresenter <ChangeUsernamePresenter>()
                             .RegisterPresenter <LoginPresenter>()
                             .RegisterPresenter <MainPresener>()
                             .RegisterView <ILoginView, LoginForm>()
                             .RegisterView <IMainView, MainForm>()
                             .RegisterView <IChangeUsernameView, ChangeUserNameForm>()
                             .RegisterService <ILoginService, StupidLoginService>()
                             .RegisterInstance(new ApplicationContext())
                             .BuildContainer()
                             .OpenContainerScope();

            controller.Run <LoginPresenter>();

            controller.CloseContainerScope();
        }