Exemple #1
0
 public static void Deconstruct(
     this MemberBinding expr,
     out MemberInfo member,
     out MemberBindingType memberType)
 {
     memberType = expr?.BindingType
                  ?? throw new ArgumentNullException(nameof(expr));
     member = expr.Member;
 }
Exemple #2
0
 public static void Deconstruct(
     this MemberAssignment expr,
     out Expression body,
     out MemberInfo member,
     out MemberBindingType binding)
 {
     body = expr?.Expression
            ?? throw new ArgumentNullException(nameof(expr));
     member  = expr.Member;
     binding = expr.BindingType;
 }
Exemple #3
0
 public static void Deconstruct(
     this MemberMemberBinding expr,
     out MemberInfo member,
     out List <MemberBinding> bindings,
     out MemberBindingType bindingType)
 {
     bindings = expr?.Bindings.ToList()
                ?? throw new ArgumentNullException(nameof(expr));
     member      = expr.Member;
     bindingType = expr.BindingType;
 }
Exemple #4
0
 public static void Deconstruct(
     this MemberListBinding expr,
     out MemberInfo member,
     out MemberBindingType bindingType,
     out List <ElementInit> initializers)
 {
     member = expr?.Member
              ?? throw new ArgumentNullException(nameof(expr));
     initializers = expr.Initializers.ToList();
     bindingType  = expr.BindingType;
 }
Exemple #5
0
        internal EvaluatedMemberBinding(MemberBindingType type, MemberInfo member)
        {
            BindingType = type;
            Member      = member;

            IsSuccess = true;
            IsSingle  = true;

            if (type == MemberBindingType.ListBinding)
            {
                EvaluatedInitializers = new List <EvaluatedListInitializer>();
            }

            if (type == MemberBindingType.MemberBinding)
            {
                EvaluatedBindings = new List <EvaluatedMemberBinding>();
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MemberBindingRepresentationBase"/> class.
        /// </summary>
        /// <param name="type">The type with member.</param>
        /// <param name="memberInfo">The member info representation.</param>
        /// <param name="bindingType">Type of the binding.</param>
        protected MemberBindingRepresentationBase(
            TypeRepresentation type,
            MemberInfoRepresentation memberInfo,
            MemberBindingType bindingType)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            if (memberInfo == null)
            {
                throw new ArgumentNullException(nameof(memberInfo));
            }

            this.Type        = type;
            this.MemberInfo  = memberInfo;
            this.BindingType = bindingType;
        }
Exemple #7
0
        internal virtual MemberBinding VisitBinding(MemberBinding binding)
        {
            MemberBindingType bindingType = binding.BindingType;

            switch (bindingType)
            {
            case MemberBindingType.Assignment:
            {
                return(this.VisitMemberAssignment((MemberAssignment)binding));
            }

            case MemberBindingType.MemberBinding:
            {
                return(this.VisitMemberMemberBinding((MemberMemberBinding)binding));
            }

            case MemberBindingType.ListBinding:
            {
                return(this.VisitMemberListBinding((MemberListBinding)binding));
            }
            }
            throw new InvalidOperationException(String.Format("Unhandled Binding Type {0}", binding.BindingType));
        }
        public static MemberBinding Visit(ITreeNodeBase parent, ITreeNode<Expression> parentBlock, MemberBindingType memberBindingType, XElement configurationElement, Type parentType)
        {
            BaseMemberBinding memberBinding = null;

            switch (memberBindingType)
            {
                case MemberBindingType.ListBinding:

                    memberBinding = new ListBindingInjector(parent, parentBlock, configurationElement, parentType);
                    break;

                case MemberBindingType.MemberBinding:

                    memberBinding = new MemberMemberBindingInjector(parent, parentBlock, configurationElement, parentType);
                    break;

                case MemberBindingType.Assignment:
                default:
                    memberBinding = new MemberAssignmentInjector(parent, parentBlock, configurationElement, parentType);
                    break;
            }

            return memberBinding.Value;
        }
 protected MemberBinding(MemberBindingType type, MemberInfo member) {
     _type = type;
     _member = member;
 }
Exemple #10
0
 protected MemberBindingNode(INodeFactory factory, MemberBindingType bindingType, MemberInfo memberInfo)
     : base(factory)
 {
     this.BindingType = bindingType;
     this.Member      = new MemberInfoNode(this.Factory, memberInfo);
 }
Exemple #11
0
 protected MemberBinding(MemberBindingType type, MemberInfo member)
 {
     _type   = type;
     _member = member;
 }
Exemple #12
0
 internal static Exception UnhandledBindingType(MemberBindingType memberBindingType)
 {
     return new NotSupportedException(Strings.ELinq_UnhandledBindingType(memberBindingType));
 }
 protected MemberBinding(MemberBindingType type, System.Reflection.MemberInfo member)
 {
 }
Exemple #14
0
 public MemberBinding(MemberBindingType bindingType, MemberInfo member)
 {
     BindingType = bindingType;
     Member = member;
 }
 protected EditableMemberBinding(MemberBindingType type, MemberInfo member)
 {
     BindingType = type;
     Member = member;
 }
 internal static Exception UnhandledBindingType(MemberBindingType memberBindingType)
 {
     return(EntityUtil.NotSupported(System.Data.Entity.Strings.ELinq_UnhandledBindingType(memberBindingType)));
 }
 protected MemberBinding(MemberBindingType type, System.Reflection.MemberInfo member)
 {
 }
Exemple #18
0
 public static Exception UnhandledBindingType(MemberBindingType bindingType)
 {
     return(new InvalidOperationException(String.Format(Strings.UnhandledBindingType, bindingType)));
 }
 private static int CalcHashCode(MemberBindingType bindingType)
 {
     return((int)bindingType);
 }
Exemple #20
0
 public MemberMemberBinding(MemberBindingType bindingType, MemberInfo member, List<MemberBinding> bindings) : base(bindingType, member)
 {
     Bindings = bindings;
 }
Exemple #21
0
 // Methods
 private Exception UnhandledBindingType(MemberBindingType memberBindingType)
 {
     throw new InvalidOperationException(string.Format("Unknown binding type '{0}'.", memberBindingType));
 }
 internal MemberBinding(MemberBindingType bindingType, MemberInfo member)
 {
     BindingType = bindingType;
     Member      = member;
 }
    // Summary:
    //     Initializes a new instance of the System.Linq.Expressions.MemberBinding class.
    //
    // Parameters:
    //   type:
    //     The System.Linq.Expressions.MemberBindingType that discriminates the type
    //     of binding that is represented.
    //
    //   member:
    //     The System.Reflection.MemberInfo that represents a field or property to be
    //     initialized.

    protected MemberBinding(MemberBindingType type, MemberInfo member)
    {
      Contract.Requires(member != null);
    }
Exemple #24
0
 //[ObsoleteAttribute("Do not use this constructor. It will be removed in future releases.")]
 protected MemberBinding(MemberBindingType type, MemberInfo member)
 {
     throw new NotImplementedException();
 }
Exemple #25
0
 internal MemberBinding(MemberBindingType binding_type, MemberInfo member)
 {
     this.binding_type = binding_type;
     this.member       = member;
 }
        // Summary:
        //     Initializes a new instance of the System.Linq.Expressions.MemberBinding class.
        //
        // Parameters:
        //   type:
        //     The System.Linq.Expressions.MemberBindingType that discriminates the type
        //     of binding that is represented.
        //
        //   member:
        //     The System.Reflection.MemberInfo that represents a field or property to be
        //     initialized.

        protected MemberBinding(MemberBindingType type, MemberInfo member)
        {
            Contract.Requires(member != null);
        }
 protected SerializableMemberBinding(SerializationInfo info, StreamingContext context)
 {
     Member      = info.GetString("Member").GetMemberFromSerializableForm();
     BindingType = (MemberBindingType)Enum.Parse(typeof(MemberBindingType), info.GetString("BindingType"));
 }
Exemple #28
0
 public static Exception UnhandledBindingType(MemberBindingType bindingType)
 {
     return(new NotSupportedException(string.Format("Unknown LINQ binding of type '{0}'.", bindingType)));
 }
Exemple #29
0
 protected MemberBinding(MemberBindingType type, MemberInfo member)
 {
     this._type   = type;
     this._member = member;
 }
Exemple #30
0
 protected EditableMemberBinding(MemberBindingType type, MemberInfo member)
 {
     BindingType = type;
     Member      = member;
 }
 protected MemberBinding(MemberBindingType bindingType, MemberInfo member)
 {
     _bindingType = bindingType;
     _member = member;
 }
Exemple #32
0
 internal static Exception UnhandledBindingType(MemberBindingType memberBindingType)
 {
     return(new NotSupportedException(Strings.ELinq_UnhandledBindingType(memberBindingType)));
 }
Exemple #33
0
 public MemberListBinding(MemberBindingType bindingType, MemberInfo member, List <ElementInit> initializers) : base(bindingType, member)
 {
     Initializers = initializers;
 }
		protected MemberBinding (MemberBindingType binding_type, MemberInfo member)
		{
			this.binding_type = binding_type;
			this.member = member;
		}
Exemple #35
0
 public MemberBinding(MemberBindingType bindingType, MemberInfo member)
 {
     BindingType = bindingType;
     Member      = member;
 }
Exemple #36
0
 public override MemberBindingRepresentationBase DeepCloneWithBindingType(MemberBindingType bindingType)
 {
     throw new NotSupportedException("The constructor in-use (by code gen) for MemberAssignmentRepresentation does not have a parameter that corresponds with the 'BindingType' property.  As such, this method, DeepCloneWithBindingType(MemberBindingType bindingType), cannot utilize the specified 'bindingType' value for that property.");
 }
Exemple #37
0
 public virtual MemberBindingRepresentationBase DeepCloneWithBindingType(MemberBindingType bindingType)
 {
     throw new NotImplementedException("This method should be abstract.  It was generated as virtual so that you aren't forced to override it when you create a new model that derives from this model.  It will be overridden in the generated designer file.");
 }
Exemple #38
0
 public static Exception UnhandledBindingType(MemberBindingType bindingType)
 {
     return(new InvalidOperationException("UnhandledBindingType: " + bindingType + "."));
 }
 protected MemberBindingNode(NodeContext factory, MemberBindingType bindingType, MemberInfo memberInfo) : base(factory)
 {
     BindingType = bindingType;
     Member = new MemberInfoNode(Context, memberInfo);
 }
Exemple #40
0
 protected MemberBinding(MemberBindingType binding_type, MemberInfo member)
 {
     this.binding_type = binding_type;
     this.member       = member;
 }
 protected MemberBindingNode(INodeFactory factory, MemberBindingType bindingType, MemberInfo memberInfo)
     : base(factory)
 {
     this.BindingType = bindingType;
     this.Member = new MemberInfoNode(this.Factory, memberInfo);
 }
Exemple #42
0
            public BogusBinding(MemberBindingType type, MemberInfo member)
#pragma warning disable 618
                : base(type, member)
#pragma warning restore 618
            {
            }
		internal MemberBinding (MemberBindingType binding_type, MemberInfo member)
		{
			this.binding_type = binding_type;
			this.member = member;
		}