/// <summary>
        /// Get the Valid State from the current Page
        /// </summary>
        /// <returns></returns>
        private bool checkisPlausible()
        {
            bool yesDataIsValid = false;

            SingleConnectionSettings con1 = connection_1.getUserParams();
            SingleConnectionSettings con2 = connection_2.getUserParams();


            if ((connection_1.checkisPlausible() && connection_2.checkisPlausible()))
            {
                // Bevor we can compare those Variables we have to figure out wich Interface is used!
                if (con1.currentConnectionSetting == con2.currentConnectionSetting)
                {
                    if (con1.currentConnectionSetting == 1)
                    {
                        // It is not Possible that two Servers listen to the Same Port...
                        if (con1.tcpSettings.clientServerSelection == "Server" &&
                            con2.tcpSettings.clientServerSelection == "Server" &&
                            con1.tcpSettings.port == con2.tcpSettings.port)
                        {
                            yesDataIsValid = false;
                        }
                        else
                        {
                            yesDataIsValid = true;
                        }
                    }
                    else
                    {
                        if (con1.serialSettings.port == con2.serialSettings.port)
                        {
                            yesDataIsValid = false;
                        }
                        else
                        {
                            yesDataIsValid = true;
                        }
                    }
                }


                // Color the UI for the User to show wich setting is not ok..
                if (!yesDataIsValid)
                {
                    // Set the Boarder Thicknes. To show the user te wrong Input
                    BoarderSettingsContenFrame2.BorderBrush = Brushes.Red;
                }
                else
                {
                    // Hide the Boarder to let the User know that the input is valid
                    BoarderSettingsContenFrame2.BorderBrush = Brushes.LightGray;
                }
            }


            // Check if both Connections are OK
            return(yesDataIsValid);
        }
Пример #2
0
        /// <summary>
        /// Check the Param State of the Pages
        /// </summary>
        /// <returns>Returns True if all Data inserted are valid. False if their is an Value that is not Valid</returns>
        private bool checkPlauseability()
        {
            bool dataIsPlausible = false;

            if (ConectionSettingTabControl.SelectedIndex == 0)
            {
                dataIsPlausible = singleConnectionPage.checkisPlausible();
            }
            else if (ConectionSettingTabControl.SelectedIndex == 1)
            {
                dataIsPlausible = connectyInTheMiddlepage.dataIsValid;
            }

            return(dataIsPlausible);
        }