示例#1
0
        public BootStrap(ServiceLocator serviceLocator)
        {
            var webClient = new DelegateWebClient();

            var sessionHelper = new SessionHelper(webClient);

            var serviceSetup = new ServiceSetup()
            {
                BaseUrl = "http://localhost:3022",
            };

            serviceLocator.Navigator = (Application.Current as App).RootFrame;

            #if NO_SERVICE
            serviceLocator.AccountService = new FakeAccountService();
            #else
            serviceLocator.AccountService = new AccountService(webClient, serviceSetup, sessionHelper);
            #endif

            serviceLocator.AccountViewModel = new AccountViewModel(serviceLocator.AccountService, serviceLocator.Navigator);

            #if NO_SERVICE
            serviceLocator.GameService = new FakeGameService();
            #else
            serviceLocator.GameService = new GameService(webClient, serviceSetup);
            #endif

            serviceLocator.MenuGameViewModel = new MenuGameViewModel(serviceLocator.GameService, serviceLocator.Navigator);

            serviceLocator.GameViewModel = new GameViewModel(serviceLocator.GameService);
        }
示例#2
0
 public AccountService(DelegateWebClient webClient, ServiceSetup serviceSetup, SessionHelper sessionHelper)
 {
     this.webClient = webClient;
     this.serviceSetup = serviceSetup;
     this.sessionHelper = sessionHelper;
 }