/// <summary>
 /// general fonction to move
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Inner_moveTo(object sender, MoveToEventArgs e)
 {
     if (e.page.Equals("BuildingNew"))
     {
         ((VMBuilding)ViewModels.ElementAt((int)InnerDecksView.BUILDING)).Clear();
         e.page = "Building";
     }
     this.move_To(e.page);
 }
Esempio n. 2
0
        void r_DERO(object sender, serverReturnEventArgs e)
        {
            if (e.data.Contains("OK"))
            {
                MoveToEventArgs args = new MoveToEventArgs("Rooms");
                EventHandler<MoveToEventArgs> handler = this.getMoveTo();

                if (handler != null)
                    handler(this, args);
            }
        }
Esempio n. 3
0
        private void modifyEvent(object param)
        {
            MoveToEventArgs e = new MoveToEventArgs("ModifyEvent");
            EventHandler<MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
                handler(this, e);
        }
        /// <summary>
        /// return to home view
        /// </summary>
        /// <param name="param"></param>
        private void goHome(object param)
        {
            setEvent(String.Empty, String.Empty, String.Empty, String.Empty);
            errMess = String.Empty;
            MoveToEventArgs e = new MoveToEventArgs("Home");
            EventHandler<MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
                handler(this, e);
        }
Esempio n. 5
0
        /// <summary>
        /// event click build new deck
        /// </summary>
        /// <param name="param"></param>
        private void buildNew(object param)
        {
            MoveToEventArgs args = new MoveToEventArgs("BuildingNew");
            EventHandler<MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
                handler(this, args);
        }
Esempio n. 6
0
        private void iAmReady(object param)
        {
            MoveToEventArgs e = new MoveToEventArgs("Game");
            EventHandler<MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
                handler(this, e);
        }
Esempio n. 7
0
        private void leaveTheRoom()
        {
            MoveToEventArgs args = new MoveToEventArgs("Rooms");
            EventHandler<MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
                handler(this, args);
        }
Esempio n. 8
0
        void r_SGNI(object sender, serverReturnEventArgs e)
        {
            if (e.data.Contains("OK"))
            {

                password = "";
                MoveToEventArgs m = new MoveToEventArgs("InnerBoard");
                EventHandler<MoveToEventArgs> handler = this.getMoveTo();

                if (handler != null)
                    handler(this, m);
            }
            else
                this.message = "Log in failed.";
        }
Esempio n. 9
0
 /*
  * event for navigation 
  */
 private void Switcher_moveTo(object sender, MoveToEventArgs e)
 {
     this.moveTo(e.page);
 }
Esempio n. 10
0
        private void cancelRoom(object param)
        {
            MoveToEventArgs e = new MoveToEventArgs("Rooms");
            EventHandler<MoveToEventArgs> handler = this.getMoveTo();
            errVisibility = Visibility.Hidden;

            if (handler != null)
                handler(this, e);
        }
Esempio n. 11
0
        void r_CNRO(object sender, serverReturnEventArgs e)
        {
            if (!e.data.Contains("KO"))
            {
                Room created = new Room(int.Parse(e.data), name, Format, RoomName, 0);
                RoomEventArgs rargs = new RoomEventArgs(created);
                if (roomCreation != null)
                    roomCreation(this, rargs);


                MoveToEventArgs args = new MoveToEventArgs("Room");
                EventHandler<MoveToEventArgs> handler = this.getMoveTo();

                if (handler != null)
                    handler(this, args);
            }
        }
Esempio n. 12
0
 private void Inner_moveTo(object sender, MoveToEventArgs e)
 {
     this.move_To(e.page);
 }
Esempio n. 13
0
        void r_RSET(object sender, serverReturnEventArgs e)
        {

            Application.Current.Dispatcher.Invoke(new Action(delegate()
                        {
            Deck.Clear();
            Hand.Clear();
            MyBoard.Clear();
            OppBoard.Clear();
            Exile.Clear();
            Grave.Clear();
            MYPV = 20;
            HISPV = 20;
                        }), null);
            MoveToEventArgs args = new MoveToEventArgs("Room");
            EventHandler<MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
                handler(this, args);
        }
Esempio n. 14
0
        private void CreateRoom(object param)
        {
            MoveToEventArgs e = new MoveToEventArgs("CreateRoom");
            EventHandler<MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
                handler(this, e);
        }
Esempio n. 15
0
        void r_JORO(object sender, serverReturnEventArgs e)
        {
            if (e.data.Contains("OK"))
            {
                RoomEventArgs rargs = new RoomEventArgs(selectedRoom);
                if (roomJoin != null)
                    roomJoin(this, rargs);

                MoveToEventArgs args = new MoveToEventArgs("Room");
                EventHandler<MoveToEventArgs> handler = this.getMoveTo();

                if (handler != null)
                    handler(this, args);
            }
        }
Esempio n. 16
0
        /*
         * This function release the event with the good argument.
         */
        private void disconnection(object param)
        {
            /*
             * putting the home screen as default screen for next connexion
             */
            move_To("Home"); 

            /*
             * go back to log screen
             */
            MoveToEventArgs e = new MoveToEventArgs("logIn");
            EventHandler<MoveToEventArgs> handler = this.getMoveTo();

            if (handler != null)
                handler(this, e);
        }