Example #1
0
        /***
         * the function Connect_botton represent the pressing on the connect button and show the displaywindow.
         ***/
        private void Connect_botton(object sender1, RoutedEventArgs e)
        {
            try
            {
                if (!String.IsNullOrEmpty(Ip.Text) && !String.IsNullOrEmpty(Port.Text))
                {
                    DisplayWindow displayWindow = new DisplayWindow(Ip.Text, Port.Text);

                    displayWindow.Show();
                }
            }
            catch (FormatException)
            {
                errorMessage("Invalid IP or PORT");
            }
            catch (InvalidOperationException)
            {
                errorMessage("Invalid IP or PORT");
            }
            catch (ArgumentOutOfRangeException)
            {
                errorMessage("Invalid IP or PORT");
            }
            catch (SocketException)
            {
                errorMessage("Connection Error");
            }
        }
Example #2
0
        /***
         * the function Button_Click will present the pressing on the connect button and show the displaywindow.
         ***/
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            DisplayWindow displayWindow = new DisplayWindow();

            displayWindow.Show();
        }