WorkEvent.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //using System;
  2. //using System.Collections.Generic;
  3. //using System.Linq;
  4. //using System.Text;
  5. //using System.Threading.Tasks;
  6. //namespace Optimizer.Models {
  7. // public sealed class WorkEvent : List<WorkEventArgs> {
  8. // static object _lockObject = new object();
  9. // static object _syncRoot = new object();
  10. // static volatile WorkEvent _instance;
  11. // private WorkEvent() { }
  12. // public static WorkEvent Instance {
  13. // get {
  14. // if (_instance == null) {
  15. // lock (_syncRoot) {
  16. // if (_instance == null) {
  17. // _instance = new WorkEvent();
  18. // }
  19. // }
  20. // }
  21. // return _instance;
  22. // }
  23. // }
  24. // public new void Add(WorkEventArgs wea) {
  25. // lock (_lockObject) {
  26. // base.Add(wea);
  27. // }
  28. // }
  29. // public new void Remove(WorkEventArgs wea) {
  30. // lock (_lockObject) {
  31. // base.Remove(wea);
  32. // }
  33. // }
  34. // public WorkEventArgs GetEventObject() {
  35. // if (this.Count > 0) {
  36. // if (this[0] != null) {
  37. // WorkEventArgs dwoTemp = this[0];
  38. // Remove(this[0]);
  39. // return dwoTemp;
  40. // }
  41. // else {
  42. // return null;
  43. // }
  44. // }
  45. // else {
  46. // return null;
  47. // }
  48. // }
  49. // }
  50. //}