PeerCastStation.GUI.MainForm.portsList_SelectedIndexChanged C# (CSharp) Method

portsList_SelectedIndexChanged() private method

private portsList_SelectedIndexChanged ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
    private void portsList_SelectedIndexChanged(object sender, EventArgs e)
    {
      var item = portsList.SelectedItem as PortListItem;
      if (item!=null) {
        var listener = item.Listener;
        portGlobalRelay.Checked     = (listener.GlobalOutputAccepts & OutputStreamType.Relay)!=0;
        portGlobalDirect.Checked    = (listener.GlobalOutputAccepts & OutputStreamType.Play)!=0;
        portGlobalInterface.Checked = (listener.GlobalOutputAccepts & OutputStreamType.Interface)!=0;
        portLocalRelay.Checked      = (listener.LocalOutputAccepts & OutputStreamType.Relay)!=0;
        portLocalDirect.Checked     = (listener.LocalOutputAccepts & OutputStreamType.Play)!=0;
        portLocalInterface.Checked  = (listener.LocalOutputAccepts & OutputStreamType.Interface)!=0;
        portGlobalRelay.Enabled     = true;
        portGlobalDirect.Enabled    = true;
        portGlobalInterface.Enabled = true;
        portLocalRelay.Enabled      = true;
        portLocalDirect.Enabled     = true;
        portLocalInterface.Enabled  = true;
      }
      else {
        portGlobalRelay.Enabled     = false;
        portGlobalDirect.Enabled    = false;
        portGlobalInterface.Enabled = false;
        portLocalRelay.Enabled      = false;
        portLocalDirect.Enabled     = false;
        portLocalInterface.Enabled  = false;
      }
    }