private void UpdateOutputList(Channel channel)
{
var idx = connectionList.SelectedIndex;
connectionList.BeginUpdate();
connectionList.Items.Clear();
connectionList.Items.Add(new ChannelConnectionSourceItem(channel.SourceStream));
var announcings = peerCast.YellowPages
.Select(yp => yp.AnnouncingChannels.FirstOrDefault(c => c.Channel.ChannelID==channel.ChannelID))
.Where(c => c!=null);
foreach (var announcing in announcings.ToArray()) {
connectionList.Items.Add(new ChannelConnectionAnnouncingItem(announcing));
}
foreach (var os in channel.OutputStreams.ToArray()) {
connectionList.Items.Add(new ChannelConnectionOutputItem(os));
}
connectionList.SelectedIndex = Math.Min(idx, connectionList.Items.Count-1);
connectionList.EndUpdate();
}