public void SetUp() { _Collection = new StrongCacheCollection<string, MyObject>(o => o.Name); _Un = new MyObject(_1n, 1); _Deux = new MyObject(_2n, 2); _Trois = new MyObject(_3n, 3); _Quatre = new MyObject(_4n, 4); _Cinq = new MyObject(_5n, 5); _Six = new MyObject(_6n, 6); _Collection.Register(_Un); _Collection.Register(_Deux); _Collection.Register(_Trois); _Collection.Register(_Quatre); _Collection.Register(_Cinq); _Collection.Register(_Six); _Elements = new List<MyObject>(); _Elements.Add(_Un); _Elements.Add(_Deux); _Elements.Add(_Trois); _Elements.Add(_Quatre); _Elements.Add(_Cinq); _Elements.Add(_Six); _Keys = new List<string>(); _Keys.AddRange(from el in _Elements orderby el.Name select el.Name); _Collection2 = new StrongCacheCollection<string, MyObject>(o => o.Name, s => s.ToUpper(), () => new Dictionary<string, MyObject>()); _Elements.Apply(co => _Collection2.Register(co)); }
//public ReadOnlyObservableCollection<IReadOnlyPlayList> AllPlayList //{ // get // { // if (_VisiblePlayList==null) // _VisiblePlayList = new UISafeReadOnlyObservableCollection<IReadOnlyPlayList>(_PlayList); // return _VisiblePlayList; // } //} public void Dispose() { if (_PlayLists != null) { _PlayLists.Values.Apply(o => o.Dispose()); _PlayLists.Dispose(); _PlayLists = null; } }