DuplicateWaitObjectException.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. /*=============================================================================
  5. **
  6. **
  7. **
  8. ** Purpose: Exception class for duplicate objects in WaitAll/WaitAny.
  9. **
  10. **
  11. =============================================================================*/
  12. using System.Runtime.Serialization;
  13. namespace System
  14. {
  15. // The DuplicateWaitObjectException is thrown when an object
  16. // appears more than once in the list of objects to WaitAll or WaitAny.
  17. [Serializable]
  18. [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
  19. public class DuplicateWaitObjectException : ArgumentException
  20. {
  21. // Creates a new DuplicateWaitObjectException with its message
  22. // string set to a default message.
  23. public DuplicateWaitObjectException()
  24. : base(SR.Arg_DuplicateWaitObjectException)
  25. {
  26. HResult = HResults.COR_E_DUPLICATEWAITOBJECT;
  27. }
  28. public DuplicateWaitObjectException(string parameterName)
  29. : base(SR.Arg_DuplicateWaitObjectException, parameterName)
  30. {
  31. HResult = HResults.COR_E_DUPLICATEWAITOBJECT;
  32. }
  33. public DuplicateWaitObjectException(string parameterName, string message)
  34. : base(message, parameterName)
  35. {
  36. HResult = HResults.COR_E_DUPLICATEWAITOBJECT;
  37. }
  38. public DuplicateWaitObjectException(string message, Exception innerException)
  39. : base(message, innerException)
  40. {
  41. HResult = HResults.COR_E_DUPLICATEWAITOBJECT;
  42. }
  43. protected DuplicateWaitObjectException(SerializationInfo info, StreamingContext context) : base(info, context)
  44. {
  45. }
  46. }
  47. }