The Labs \ Source Viewer \ SSCLI \ System \ MemberAccessException

  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. // MemberAccessException
  17. // Thrown when we try accessing a member that we cannot
  18. // access, due to it being removed, private or something similar.
  19. ////////////////////////////////////////////////////////////////////////////////
  20. namespace System
  21. {
  22.    
  23.     using System;
  24.     using System.Runtime.Serialization;
  25.     // The MemberAccessException is thrown when trying to access a class
  26.     // member fails.
  27.     //
  28.     [System.Runtime.InteropServices.ComVisible(true)]
  29.     [Serializable()]
  30.     public class MemberAccessException : SystemException
  31.     {
  32.        
  33.         // Creates a new MemberAccessException with its message string set to
  34.         // the empty string, its HRESULT set to COR_E_MEMBERACCESS,
  35.         // and its ExceptionInfo reference set to null.
  36.         public MemberAccessException() : base(Environment.GetResourceString("Arg_AccessException"))
  37.         {
  38.             SetErrorCode(__HResults.COR_E_MEMBERACCESS);
  39.         }
  40.        
  41.         // Creates a new MemberAccessException with its message string set to
  42.         // message, its HRESULT set to COR_E_ACCESS,
  43.         // and its ExceptionInfo reference set to null.
  44.         //
  45.         public MemberAccessException(string message) : base(message)
  46.         {
  47.             SetErrorCode(__HResults.COR_E_MEMBERACCESS);
  48.         }
  49.        
  50.         public MemberAccessException(string message, Exception inner) : base(message, inner)
  51.         {
  52.             SetErrorCode(__HResults.COR_E_MEMBERACCESS);
  53.         }
  54.        
  55.         protected MemberAccessException(SerializationInfo info, StreamingContext context) : base(info, context)
  56.         {
  57.         }
  58.        
  59.     }
  60. }

Developer Fusion