Beispiel #1
0
        private void ChannelList_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                ChannelCtrl ctrl = new ChannelCtrl();
                ctrl.Dock           = DockStyle.Top;
                ctrl.StatusChanged += Channel_StatusChanged;
                ctrl.Init((IChannel)e.NewItems[0]);
                ThreadSafe(delegate { statusPnlOffline.Channels.Controls.Add(ctrl); });
                break;

            case NotifyCollectionChangedAction.Reset:
                break;

            case NotifyCollectionChangedAction.Remove:
            case NotifyCollectionChangedAction.Move:
            case NotifyCollectionChangedAction.Replace:
            default:
                break;
            }
        }