The Labs \ Source Viewer \ SSCLI \ System \ ContextMarshalException

  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: ContextMarshalException
  18. **
  19. **
  20. ** Purpose: Exception class for attempting to pass an instance through a context
  21. **          boundary, when the formal type and the instance's marshal style are
  22. **          incompatible.
  23. **
  24. **
  25. =============================================================================*/
  26. namespace System
  27. {
  28.     using System.Runtime.InteropServices;
  29.     using System.Runtime.Remoting;
  30.     using System;
  31.     using System.Runtime.Serialization;
  32.     [Obsolete("ContextMarshalException is obsolete.")]
  33.     [System.Runtime.InteropServices.ComVisible(true)]
  34.     [Serializable()]
  35.     public class ContextMarshalException : SystemException
  36.     {
  37.         public ContextMarshalException() : base(Environment.GetResourceString("Arg_ContextMarshalException"))
  38.         {
  39.             SetErrorCode(__HResults.COR_E_CONTEXTMARSHAL);
  40.         }
  41.        
  42.         public ContextMarshalException(string message) : base(message)
  43.         {
  44.             SetErrorCode(__HResults.COR_E_CONTEXTMARSHAL);
  45.         }
  46.        
  47.         public ContextMarshalException(string message, Exception inner) : base(message, inner)
  48.         {
  49.             SetErrorCode(__HResults.COR_E_CONTEXTMARSHAL);
  50.         }
  51.        
  52.         protected ContextMarshalException(SerializationInfo info, StreamingContext context) : base(info, context)
  53.         {
  54.         }
  55.        
  56.     }
  57.    
  58. }

Developer Fusion