PageRenderTime 48ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/V1/spikes/AGCompositeApplicationLibrary/AGComposite.Wpf.Tests/Mocks/MockViewsCollection.cs

#
C# | 52 lines | 29 code | 7 blank | 16 comment | 0 complexity | 436d7f60e343f77d8ae55a3bcf15b0c9 MD5 | raw file
  1. //===============================================================================
  2. // Microsoft patterns & practices
  3. // Composite Application Guidance for Windows Presentation Foundation and Silverlight
  4. //===============================================================================
  5. // Copyright (c) Microsoft Corporation. All rights reserved.
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
  7. // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
  8. // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  9. // FITNESS FOR A PARTICULAR PURPOSE.
  10. //===============================================================================
  11. // The example companies, organizations, products, domain names,
  12. // e-mail addresses, logos, people, places, and events depicted
  13. // herein are fictitious. No association with any real company,
  14. // organization, product, domain name, email address, logo, person,
  15. // places, or events is intended or should be inferred.
  16. //===============================================================================
  17. using System.Collections;
  18. using System.Collections.Generic;
  19. using System.Collections.ObjectModel;
  20. using System.Collections.Specialized;
  21. using Microsoft.Practices.Composite.Regions;
  22. namespace Microsoft.Practices.Composite.Wpf.Tests.Mocks
  23. {
  24. class MockViewsCollection : IViewsCollection
  25. {
  26. public ObservableCollection<object> Items = new ObservableCollection<object>();
  27. public bool Contains(object value)
  28. {
  29. return Items.Contains(value);
  30. }
  31. public IEnumerator<object> GetEnumerator()
  32. {
  33. return Items.GetEnumerator();
  34. }
  35. IEnumerator IEnumerable.GetEnumerator()
  36. {
  37. return GetEnumerator();
  38. }
  39. public event NotifyCollectionChangedEventHandler CollectionChanged
  40. {
  41. add { Items.CollectionChanged += value; }
  42. remove { Items.CollectionChanged -= value; }
  43. }
  44. }
  45. }