Exemplo n.º 1
0
        private void Listening_Click(object sender, RoutedEventArgs e)
        {
            // Start Server
            string IP = HostIP.Text;

            playerNum = int.Parse(gameNumBox.Text);
            Thread thread = new Thread(delegate()
            {
                doServer(IP, this.playerNum);
            });

            thread.Start();

            // Start Client
            ClientJoin cJoin = new ClientJoin();

            cJoin.Show();
            cJoin.textIP.Text   = IP;
            cJoin.textName.Text = this.gameID.Text;
            ButtonAutomationPeer peer       = new ButtonAutomationPeer(cJoin.btnConnect);
            IInvokeProvider      invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;

            invokeProv.Invoke();
            this.Close();
        }
Exemplo n.º 2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            ClientJoin ClientJoin = new ClientJoin();

            ClientJoin.Show();
            this.Close();
        }
Exemplo n.º 3
0
        public DataItem(string p_name, Player p)
        {
            Column1 = p_name;
            Column2 = p.handcard.Count.ToString();
            Dictionary <string, int> pDic = ClientJoin.CalculateCard(p.showedcardlist);

            Column3  = pDic["cocktail"].ToString();
            Column4  = pDic["rat"].ToString();
            Column5  = pDic["scorpion"].ToString();
            Column6  = pDic["fly"].ToString();
            Column7  = pDic["toad"].ToString();
            Column8  = pDic["spider"].ToString();
            Column9  = pDic["bat"].ToString();
            Column10 = pDic["bug"].ToString();
        }
Exemplo n.º 4
0
 public ClientPage(ClientJoin c1)
 {
     this.c = c1;
     InitializeComponent();
 }
Exemplo n.º 5
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     ClientJoin ClientJoin = new ClientJoin();
     ClientJoin.Show();
     this.Close();
 }
Exemplo n.º 6
0
 public ClientPage(ClientJoin c1)
 {
     this.c = c1;
     InitializeComponent();
 }
Exemplo n.º 7
0
        private void Listening_Click(object sender, RoutedEventArgs e)
        {
            // Start Server
            string IP = HostIP.Text;
            playerNum = int.Parse(gameNumBox.Text);
            Thread thread = new Thread(delegate()
            {
                doServer(IP, this.playerNum);
            });
            thread.Start();

            // Start Client
            ClientJoin cJoin = new ClientJoin();
            cJoin.Show();
            cJoin.textIP.Text = IP;
            cJoin.textName.Text = this.gameID.Text;
            ButtonAutomationPeer peer = new ButtonAutomationPeer(cJoin.btnConnect);
            IInvokeProvider invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
            invokeProv.Invoke();
            this.Close();
        }