The Labs \ Source Viewer \ SSCLI \ System \ DuplicateWaitObjectException

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. /*=============================================================================
  16. **
  17. ** Class: DuplicateWaitObjectException
  18. **
  19. **
  20. ** Purpose: Exception class for duplicate objects in WaitAll/WaitAny.
  21. **
  22. **
  23. =============================================================================*/
  24. namespace System
  25. {
  26.    
  27.     using System;
  28.     using System.Runtime.Remoting;
  29.     using System.Runtime.Serialization;
  30.    
  31.     // The DuplicateWaitObjectException is thrown when an object
  32.     // appears more than once in the list of objects to WaitAll or WaitAny.
  33.     //
  34.     [System.Runtime.InteropServices.ComVisible(true)]
  35.     [Serializable()]
  36.     public class DuplicateWaitObjectException : ArgumentException
  37.     {
  38.        
  39.         private static string _duplicateWaitObjectMessage = null;
  40.        
  41.         private static string DuplicateWaitObjectMessage {
  42.             get {
  43.                 if (_duplicateWaitObjectMessage == null)
  44.                     _duplicateWaitObjectMessage = Environment.GetResourceString("Arg_DuplicateWaitObjectException");
  45.                 return _duplicateWaitObjectMessage;
  46.             }
  47.         }
  48.        
  49.         // Creates a new DuplicateWaitObjectException with its message
  50.         // string set to a default message.
  51.         public DuplicateWaitObjectException() : base(DuplicateWaitObjectMessage)
  52.         {
  53.             SetErrorCode(__HResults.COR_E_DUPLICATEWAITOBJECT);
  54.         }
  55.        
  56.         public DuplicateWaitObjectException(string parameterName) : base(DuplicateWaitObjectMessage, parameterName)
  57.         {
  58.             SetErrorCode(__HResults.COR_E_DUPLICATEWAITOBJECT);
  59.         }
  60.        
  61.         public DuplicateWaitObjectException(string parameterName, string message) : base(message, parameterName)
  62.         {
  63.             SetErrorCode(__HResults.COR_E_DUPLICATEWAITOBJECT);
  64.         }
  65.        
  66.         public DuplicateWaitObjectException(string message, Exception innerException) : base(message, innerException)
  67.         {
  68.             SetErrorCode(__HResults.COR_E_DUPLICATEWAITOBJECT);
  69.         }
  70.        
  71.         // This constructor is required for serialization
  72.         protected DuplicateWaitObjectException(SerializationInfo info, StreamingContext context) : base(info, context)
  73.         {
  74.         }
  75.     }
  76. }

Developer Fusion