public void ReplaceAll(MyObservableCollection <T> collection)
 {
     this.Clear();
     foreach (T obj in collection)
     {
         this.Add(obj);
     }
     OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
 }
        public void Dispose()
        {
            if (PlayList != null)
            {
                PlayList.Clear();
                PlayList = null;
            }

            if (PlayNowList == null)
            {
                return;
            }
            foreach (var thread in PlayNowList)
            {
                thread.Dispose();
            }
            PlayNowList.Clear();
            PlayNowList = null;
        }
 public MyEnumerator(MyObservableCollection <T> list)
 {
     this.MyObservableCollection = list;
 }