Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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;
        }
Esempio n. 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));
        }
Esempio n. 8
0
        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;
 }
Esempio n. 10
0
 protected MemberBindingNode(INodeFactory factory, MemberBindingType bindingType, MemberInfo memberInfo)
     : base(factory)
 {
     this.BindingType = bindingType;
     this.Member      = new MemberInfoNode(this.Factory, memberInfo);
 }
Esempio n. 11
0
 protected MemberBinding(MemberBindingType type, MemberInfo member)
 {
     _type   = type;
     _member = member;
 }
Esempio n. 12
0
 internal static Exception UnhandledBindingType(MemberBindingType memberBindingType)
 {
     return new NotSupportedException(Strings.ELinq_UnhandledBindingType(memberBindingType));
 }
 protected MemberBinding(MemberBindingType type, System.Reflection.MemberInfo member)
 {
 }
Esempio n. 14
0
 public MemberBinding(MemberBindingType bindingType, MemberInfo member)
 {
     BindingType = bindingType;
     Member = member;
 }
Esempio n. 15
0
 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)
 {
 }
Esempio n. 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);
 }
Esempio n. 20
0
 public MemberMemberBinding(MemberBindingType bindingType, MemberInfo member, List<MemberBinding> bindings) : base(bindingType, member)
 {
     Bindings = bindings;
 }
Esempio n. 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);
    }
Esempio n. 24
0
 //[ObsoleteAttribute("Do not use this constructor. It will be removed in future releases.")]
 protected MemberBinding(MemberBindingType type, MemberInfo member)
 {
     throw new NotImplementedException();
 }
Esempio n. 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"));
 }
Esempio n. 28
0
 public static Exception UnhandledBindingType(MemberBindingType bindingType)
 {
     return(new NotSupportedException(string.Format("Unknown LINQ binding of type '{0}'.", bindingType)));
 }
Esempio n. 29
0
 protected MemberBinding(MemberBindingType type, MemberInfo member)
 {
     this._type   = type;
     this._member = member;
 }
Esempio n. 30
0
 protected EditableMemberBinding(MemberBindingType type, MemberInfo member)
 {
     BindingType = type;
     Member      = member;
 }
Esempio n. 31
0
 protected MemberBinding(MemberBindingType bindingType, MemberInfo member)
 {
     _bindingType = bindingType;
     _member = member;
 }
Esempio n. 32
0
 internal static Exception UnhandledBindingType(MemberBindingType memberBindingType)
 {
     return(new NotSupportedException(Strings.ELinq_UnhandledBindingType(memberBindingType)));
 }
Esempio n. 33
0
 public MemberListBinding(MemberBindingType bindingType, MemberInfo member, List <ElementInit> initializers) : base(bindingType, member)
 {
     Initializers = initializers;
 }
Esempio n. 34
0
		protected MemberBinding (MemberBindingType binding_type, MemberInfo member)
		{
			this.binding_type = binding_type;
			this.member = member;
		}
Esempio n. 35
0
 public MemberBinding(MemberBindingType bindingType, MemberInfo member)
 {
     BindingType = bindingType;
     Member      = member;
 }
Esempio n. 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.");
 }
Esempio n. 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.");
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 42
0
            public BogusBinding(MemberBindingType type, MemberInfo member)
#pragma warning disable 618
                : base(type, member)
#pragma warning restore 618
            {
            }
Esempio n. 43
0
		internal MemberBinding (MemberBindingType binding_type, MemberInfo member)
		{
			this.binding_type = binding_type;
			this.member = member;
		}