BmffPortabilityFactory.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Collections.Generic;
  2. using System.Collections.ObjectModel;
  3. using System.Diagnostics;
  4. using MatrixIO.IO;
  5. namespace BmffViewer
  6. {
  7. internal class BmffPortabilityFactory : PortabilityFactory
  8. {
  9. #region List Creation
  10. public override IList<T> CreateList<T>()
  11. {
  12. return new ObservableCollection<T>();
  13. }
  14. public override IList<T> CreateList<T>(IEnumerable<T> collection)
  15. {
  16. return new ObservableCollection<T>(collection);
  17. }
  18. #endregion
  19. #region Tracing
  20. public override void TraceWriteLine(object value, string category = null)
  21. {
  22. Trace.WriteLine(value, category);
  23. }
  24. public override void TraceAssert(bool condition, string message = null)
  25. {
  26. Trace.Assert(condition, message);
  27. }
  28. public override int TraceIndentLevel
  29. {
  30. get
  31. {
  32. return Trace.IndentLevel;
  33. }
  34. set
  35. {
  36. Trace.IndentLevel = value;
  37. }
  38. }
  39. #endregion
  40. }
  41. }