Esempio n. 1
0
        public void radioButton_Checked(object sender, RoutedEventArgs e)
        {
            var radioButton = (RadioButton)sender; // checked RadioButton

            if (radioButton.Name == "ConnectRB")
            {
                IPData myTpData = new IPData();
                if (myTpData.ShowDialog() == true)
                {
                    try
                    {
                        //MessageBox.Show(ServerTCP.GetLocalIPAddress());
                        if (ServerTCP.GetLocalIPAddress() == myTpData.GettingIpTbx.Text)
                        {
                            ConnectionIsServer = true;
                            ServerTCP.InitializeServer(myTpData.GettingIpTbx.Text, port);
                        }
                        else
                        {
                            ConnectionIsServer = false;
                        }
                        IpAddressData = myTpData.GettingIpTbx.Text;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }