Exemplo n.º 1
0
    private void refreshConnectionDependentComponents()
    {
        Action connected = () => {
            isConnectedLabel.Visible    = true;
            isNotConnectedLabel.Visible = false;
            connectButton.Visible       = false;
        };
        Action notConnected = () => {
            isConnectedLabel.Visible    = false;
            isNotConnectedLabel.Visible = true;
            connectButton.Visible       = true;
        };

        if (accessPoint.IsConnected())
        {
            this.Invoke(connected);
        }
        else
        {
            this.Invoke(notConnected);
        }
    }