﻿// Decompiled with JetBrains decompiler
// Type: System.MethodAccessException
// Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 255ABCDF-D9D6-4E3D-BAD4-F74D4CE3D7A8
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll

using System.Runtime;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;

namespace System
{
  /// <summary>
  /// The exception that is thrown when there is an invalid attempt to access a method, such as accessing a private method from partially trusted code.
  /// </summary>
  /// <filterpriority>2</filterpriority>
  [ComVisible(true)]
  [Serializable]
  public class MethodAccessException : MemberAccessException
  {
    /// <summary>
    /// Initializes a new instance of the <see cref="T:System.MethodAccessException"/> class, setting the <see cref="P:System.Exception.Message"/> property of the new instance to a system-supplied message that describes the error, such as "Attempt to access the method failed." This message takes into account the current system culture.
    /// </summary>
    public MethodAccessException()
      : base(Environment.GetResourceString("Arg_MethodAccessException"))
    {
      this.SetErrorCode(-2146233072);
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="T:System.MethodAccessException"/> class with a specified error message.
    /// </summary>
    /// <param name="message">A <see cref="T:System.String"/> that describes the error. </param>
    public MethodAccessException(string message)
      : base(message)
    {
      this.SetErrorCode(-2146233072);
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="T:System.MethodAccessException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception.
    /// </summary>
    /// <param name="message">The error message that explains the reason for the exception. </param><param name="inner">The exception that is the cause of the current exception. If the <paramref name="inner"/> parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. </param>
    public MethodAccessException(string message, Exception inner)
      : base(message, inner)
    {
      this.SetErrorCode(-2146233072);
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="T:System.MethodAccessException"/> class with serialized data.
    /// </summary>
    /// <param name="info">The object that holds the serialized object data. </param><param name="context">The contextual information about the source or destination. </param>
    [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
    protected MethodAccessException(SerializationInfo info, StreamingContext context)
      : base(info, context)
    {
    }
  }
}
