コード例 #1
0
        public LoginController(LoginScope scope, UIManagerService uiManager,
            ClientSiteManagerService clientSiteManagerService, MessageService messageService,
            CreateUIService createUIService, ClientManagerService clientManagerService)
        {
            myScope = scope;
            myScope.Visible = true;
            myUIManager = uiManager;
            myclientSiteManagerService = clientSiteManagerService;
            myMessageService = messageService;
            myCreateUIService = createUIService;
            this.clientManagerService = clientManagerService;
            myScope.Model = new LoginScopeModel();
/*
            scope.Model.dosomething += (o) =>
            {
                Console.WriteLine(o);
            };
*/
            scope.Model.Username = "******";
            scope.Model.Password = "******";


            myScope.Model.WindowClosed = () => { Window.Alert("woooo"); };
            myScope.Model.LoginAccount = LoginAccountFn;
            myScope.Model.CreateAccount = CreateAccountFn;
            myclientSiteManagerService.OnLogin += OnLoginFn;
            myclientSiteManagerService.OnUserCreate += OnUserCreateFn;

            /* myScope.Model.Username = "******";
            myScope.Model.Password = "******";

            */
//            Window.SetTimeout(LoginAccountFn, 250);
        }
コード例 #2
0
        public GameManagerController(GameManagerScope scope, UIManagerService uiManager, CreateUIService createUIService,
            ClientSiteManagerService clientSiteManagerService, MessageService messageService)
        {
            myScope = scope;
            myUIManager = uiManager;
            this.createUIService = createUIService;
            myClientSiteManagerService = clientSiteManagerService;
            myMessageService = messageService;
            myScope.Model = new GameManagerModel();
            myScope.Visible = true;
            myClientSiteManagerService.GetGamesByUser(myUIManager.ClientInfo.LoggedInUser.Hash);

            myClientSiteManagerService.OnGetGamesByUserReceived += OnOnGetGamesByUserReceivedFn;
            myClientSiteManagerService.OnDeveloperCreateGameReceived += OnDeveloperCreateGameReceivedFn;
            myClientSiteManagerService.OnDoesGameNameExistReceived += OnDoesGameNameExistReceivedFn;

            myScope.Model.CreateGame += CreateGameFn;
            myScope.Model.DeleteGame += DeleteGameFn;
            myScope.Watch("model.selectedGame",
                () =>
                {
                    if (myScope.Model.SelectedGame == null) return;

                    createUIService.CreateSingleton<GameEditorScope>(GameEditorController.View,
                        (_scope, elem) =>
                        {
                            _scope.Model = new GameEditorModel();
                            _scope.Model.Game = myScope.Model.SelectedGame;
                        });
                    if (!scope.Minimized)
                        scope.Minimize();
                });
        }
コード例 #3
0
 public FloatingWindowDirective(UIManagerService uiManagerService)
 {
     myUIManagerService = uiManagerService;
     restrict = "EA";
     templateUrl = string.Format("{0}partials/floatingWindow.html", Constants.ContentAddress);
     replace = true;
     transclude = true;
     scope = new
             {
                 width = "=",
                 height = "=",
                 left = "=",
                 top = "=",
                 windowTitle = "=",
                 visible = "=",
                 onclose = "&",
             };
     link = LinkFn;
 }
コード例 #4
0
        public HomeController(HomeScope scope, UIManagerService uiManager,
            ClientSiteManagerService clientSiteManagerService, CreateUIService createUIService)
        {
            myScope = scope;
            myUIManager = uiManager;
            myClientSiteManagerService = clientSiteManagerService;
            myCreateUIService = createUIService;
            myScope.Model = new HomeModel();
            myScope.Visible = false;
            scope.Model.GameTypeSelected += GameTypeSelectedFn;
            scope.Model.RoomSelected += RoomSelectedFn;
            scope.Model.CreateRoom += CreateRoomFn;
            scope.Model.CreateGame += CreateGameFn;
            scope.Model.JoinRoom += JoinRoomFn;
            scope.Watch<HomeScope>((_scope) => { return myScope.Model.SelectedGameType; },
                () => { scope.Model.GameTypeSelected(); });
            /*  scope.Watch<HomeScope>((_scope) => { return myScope.Model.SelectedRoom; },
                                 () =>
                                   {
                                       scope.Model.RoomSelected();
                                   });*/


            myClientSiteManagerService.OnGetGameTypesReceived += PopulateGames;
            myClientSiteManagerService.OnGetRoomsReceived += PopulateRooms;
            myClientSiteManagerService.OnRoomJoined += RoomJoined;
            myClientSiteManagerService.OnGetRoomInfoReceived += GetRoomInfoReceived;

            scope.OnReady += () =>
                             {
                                 myScope.SwingAway(SwingDirection.BottomLeft, true, null);
                                 myScope.SwingBack(null);
                                 myScope.Apply();
                                 myScope.Model.User = myUIManager.ClientInfo.LoggedInUser;
                                 myClientSiteManagerService.GetGameTypes();
                             };

            //Window.SetTimeout(CreateGameFn, 100);
        }