﻿// Decompiled with JetBrains decompiler
// Type: System.Linq.Expressions.MemberBinding
// Assembly: System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: BA37026F-1371-4849-854A-E2CCE7CAD02B
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Core.dll

using System;
using System.Reflection;
using System.Runtime;

namespace System.Linq.Expressions
{
  /// <summary>
  /// Provides the base class from which the classes that represent bindings that are used to initialize members of a newly created object derive.
  /// </summary>
  [__DynamicallyInvokable]
  public abstract class MemberBinding
  {
    private MemberBindingType _type;
    private MemberInfo _member;

    /// <summary>
    /// Gets the type of binding that is represented.
    /// </summary>
    /// 
    /// <returns>
    /// One of the <see cref="T:System.Linq.Expressions.MemberBindingType"/> values.
    /// </returns>
    [__DynamicallyInvokable]
    public MemberBindingType BindingType
    {
      [__DynamicallyInvokable, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] get
      {
        return this._type;
      }
    }

    /// <summary>
    /// Gets the field or property to be initialized.
    /// </summary>
    /// 
    /// <returns>
    /// The <see cref="T:System.Reflection.MemberInfo"/> that represents the field or property to be initialized.
    /// </returns>
    [__DynamicallyInvokable]
    public MemberInfo Member
    {
      [__DynamicallyInvokable, TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] get
      {
        return this._member;
      }
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="T:System.Linq.Expressions.MemberBinding"/> class.
    /// </summary>
    /// <param name="type">The <see cref="T:System.Linq.Expressions.MemberBindingType"/> that discriminates the type of binding that is represented.</param><param name="member">The <see cref="T:System.Reflection.MemberInfo"/> that represents a field or property to be initialized.</param>
    [Obsolete("Do not use this constructor. It will be removed in future releases.")]
    [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
    protected MemberBinding(MemberBindingType type, MemberInfo member)
    {
      this._type = type;
      this._member = member;
    }

    /// <summary>
    /// Returns a textual representation of the <see cref="T:System.Linq.Expressions.MemberBinding"/>.
    /// </summary>
    /// 
    /// <returns>
    /// A textual representation of the <see cref="T:System.Linq.Expressions.MemberBinding"/>.
    /// </returns>
    [__DynamicallyInvokable]
    public override string ToString()
    {
      return ExpressionStringBuilder.MemberBindingToString(this);
    }
  }
}
