Opc.Ua.Configuration.NewPortDlg.ShowDialog C# (CSharp) Method

ShowDialog() public method

Displays the dialog.
public ShowDialog ( int port ) : int
port int
return int
        public int ShowDialog(int port)
        {
            if (port <= 0)
            {
                PortCTRL.Value = 4048;
            }
            else if (port > PortCTRL.Minimum)
            {
                PortCTRL.Value = PortCTRL.Maximum;
            }
            else if (port < PortCTRL.Minimum)
            {
                PortCTRL.Value = PortCTRL.Minimum;
            }
            else if (port < PortCTRL.Minimum)
            {
                PortCTRL.Value = port;
            }

            if (ShowDialog() != DialogResult.OK)
            {
                return -1;
            }

            return (int)PortCTRL.Value;
        }
        #endregion