Exceptions.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using System;
  2. using System.Runtime.Serialization;
  3. namespace Amib.Threading
  4. {
  5. #region Exceptions
  6. /// <summary>
  7. /// Represents an exception in case IWorkItemResult.GetResult has been canceled
  8. /// </summary>
  9. public sealed partial class WorkItemCancelException : Exception
  10. {
  11. public WorkItemCancelException()
  12. {
  13. }
  14. public WorkItemCancelException(string message)
  15. : base(message)
  16. {
  17. }
  18. public WorkItemCancelException(string message, Exception e)
  19. : base(message, e)
  20. {
  21. }
  22. }
  23. /// <summary>
  24. /// Represents an exception in case IWorkItemResult.GetResult has been timed out
  25. /// </summary>
  26. public sealed partial class WorkItemTimeoutException : Exception
  27. {
  28. public WorkItemTimeoutException()
  29. {
  30. }
  31. public WorkItemTimeoutException(string message)
  32. : base(message)
  33. {
  34. }
  35. public WorkItemTimeoutException(string message, Exception e)
  36. : base(message, e)
  37. {
  38. }
  39. }
  40. /// <summary>
  41. /// Represents an exception in case IWorkItemResult.GetResult has been timed out
  42. /// </summary>
  43. public sealed partial class WorkItemResultException : Exception
  44. {
  45. public WorkItemResultException()
  46. {
  47. }
  48. public WorkItemResultException(string message)
  49. : base(message)
  50. {
  51. }
  52. public WorkItemResultException(string message, Exception e)
  53. : base(message, e)
  54. {
  55. }
  56. }
  57. /// <summary>
  58. /// Represents an exception in case IWorkItemResult.GetResult has been canceled
  59. /// </summary>
  60. [Serializable]
  61. public sealed partial class WorkItemCancelException
  62. {
  63. public WorkItemCancelException(SerializationInfo si, StreamingContext sc)
  64. : base(si, sc)
  65. {
  66. }
  67. }
  68. /// <summary>
  69. /// Represents an exception in case IWorkItemResult.GetResult has been timed out
  70. /// </summary>
  71. [Serializable]
  72. public sealed partial class WorkItemTimeoutException
  73. {
  74. public WorkItemTimeoutException(SerializationInfo si, StreamingContext sc)
  75. : base(si, sc)
  76. {
  77. }
  78. }
  79. /// <summary>
  80. /// Represents an exception in case IWorkItemResult.GetResult has been timed out
  81. /// </summary>
  82. [Serializable]
  83. public sealed partial class WorkItemResultException
  84. {
  85. public WorkItemResultException(SerializationInfo si, StreamingContext sc)
  86. : base(si, sc)
  87. {
  88. }
  89. }
  90. #endregion
  91. }