1
0

Exceptions.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Ami Bar
  2. // [email protected]
  3. using System;
  4. using System.Runtime.Serialization;
  5. namespace Amib.Threading
  6. {
  7. #region Exceptions
  8. /// <summary>
  9. /// Represents an exception in case IWorkItemResult.GetResult has been canceled
  10. /// </summary>
  11. [Serializable]
  12. public sealed class WorkItemCancelException : ApplicationException
  13. {
  14. public WorkItemCancelException() : base()
  15. {
  16. }
  17. public WorkItemCancelException(string message) : base(message)
  18. {
  19. }
  20. public WorkItemCancelException(string message, Exception e) : base(message, e)
  21. {
  22. }
  23. public WorkItemCancelException(SerializationInfo si, StreamingContext sc) : base(si, sc)
  24. {
  25. }
  26. }
  27. /// <summary>
  28. /// Represents an exception in case IWorkItemResult.GetResult has been timed out
  29. /// </summary>
  30. [Serializable]
  31. public sealed class WorkItemTimeoutException : ApplicationException
  32. {
  33. public WorkItemTimeoutException() : base()
  34. {
  35. }
  36. public WorkItemTimeoutException(string message) : base(message)
  37. {
  38. }
  39. public WorkItemTimeoutException(string message, Exception e) : base(message, e)
  40. {
  41. }
  42. public WorkItemTimeoutException(SerializationInfo si, StreamingContext sc) : base(si, sc)
  43. {
  44. }
  45. }
  46. /// <summary>
  47. /// Represents an exception in case IWorkItemResult.GetResult has been timed out
  48. /// </summary>
  49. [Serializable]
  50. public sealed class WorkItemResultException : ApplicationException
  51. {
  52. public WorkItemResultException() : base()
  53. {
  54. }
  55. public WorkItemResultException(string message) : base(message)
  56. {
  57. }
  58. public WorkItemResultException(string message, Exception e) : base(message, e)
  59. {
  60. }
  61. public WorkItemResultException(SerializationInfo si, StreamingContext sc) : base(si, sc)
  62. {
  63. }
  64. }
  65. #endregion
  66. }