#if NET20 || NET30 || !NET_4_6
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Reflection;
namespace System.Linq.Expressions.Reimplement
{
///
/// Describes the binding types that are used in MemberInitExpression objects.
///
public enum MemberBindingType
{
///
/// A binding that represents initializing a member with the value of an expression.
///
Assignment,
///
/// A binding that represents recursively initializing members of a member.
///
MemberBinding,
///
/// A binding that represents initializing a member of type or from a list of elements.
///
ListBinding
}
///
/// Provides the base class from which the classes that represent bindings that are used to initialize members of a newly created object derive.
///
public abstract class MemberBinding
{
private readonly MemberBindingType _type;
private readonly MemberInfo _member;
///
/// Initializes an instance of class.
///
/// The type of member binding.
/// The field or property to be initialized.
[Obsolete("Do not use this constructor. It will be removed in future releases.")]
protected MemberBinding(MemberBindingType type, MemberInfo member)
{
_type = type;
_member = member;
}
///
/// Gets the type of binding that is represented.
///
public MemberBindingType BindingType
{
get { return _type; }
}
///
/// Gets the field or property to be initialized.
///
public MemberInfo Member
{
get { return _member; }
}
///
/// Returns a that represents the current .
///
/// A that represents the current .
public override string ToString()
{
return ExpressionStringBuilder.MemberBindingToString(this);
}
}
}
#endif