/// <summary>
        /// Sets the window's description and selects the tunnel server
        /// with the given address.
        /// </summary>
        /// <param name="description">The window description.</param>
        /// <param name="tunnelAddress">The address of the tunnel server to select.</param>
        public void Open(string description, string tunnelAddress = null)
        {
            lblDescription.Text   = description;
            originalTunnelAddress = tunnelAddress;

            if (!string.IsNullOrWhiteSpace(tunnelAddress))
            {
                lbTunnelList.SelectTunnel(tunnelAddress);
            }
            else
            {
                lbTunnelList.SelectedIndex = -1;
            }

            if (lbTunnelList.SelectedIndex > -1)
            {
                lbTunnelList.SetTopIndex(0);

                while (lbTunnelList.SelectedIndex > lbTunnelList.LastIndex)
                {
                    lbTunnelList.TopIndex++;
                }
            }

            btnApply.AllowClick = false;
            Enable();
        }
Example #2
0
        /// <summary>
        /// Sets the window's description and selects the tunnel server
        /// with the given address.
        /// </summary>
        /// <param name="description">The window description.</param>
        /// <param name="tunnelAddress">The address of the tunnel server to select.</param>
        public void Open(string description, string tunnelAddress = null)
        {
            lblDescription.Text = description;

            if (!string.IsNullOrWhiteSpace(tunnelAddress))
            {
                lbTunnelList.SelectTunnel(tunnelAddress);
            }
            else
            {
                lbTunnelList.SelectedIndex = -1;
            }

            Enable();
        }
 /// <summary>
 /// Sets the window's description and selects the tunnel server
 /// with the given address.
 /// </summary>
 /// <param name="description">The window description.</param>
 /// <param name="tunnelAddress">The address of the tunnel server to select.</param>
 public void Open(string description, string tunnelAddress)
 {
     lblDescription.Text = description;
     lbTunnelList.SelectTunnel(tunnelAddress);
     Enable();
 }