• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Expressions.MemberAssignment类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Linq.Expressions.MemberAssignment的典型用法代码示例。如果您正苦于以下问题:C# MemberAssignment类的具体用法?C# MemberAssignment怎么用?C# MemberAssignment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MemberAssignment类属于System.Linq.Expressions命名空间,在下文中一共展示了MemberAssignment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: VisitMemberAssignment

        protected override MemberAssignment VisitMemberAssignment(MemberAssignment node)
        {
            string propertyName = node.Member.Name;
            string fieldName = DbMetaDataManager.GetFieldName(node.Member.DeclaringType, propertyName);

            if (node.Expression.NodeType == ExpressionType.Call)
            {

                VisitMethodCall((MethodCallExpression)node.Expression,fieldName);
            }
            else if (node.Expression.NodeType == ExpressionType.Convert)
            {
                var ue = node.Expression as UnaryExpression;
                var call = ue.Operand as MethodCallExpression;

                if (call != null)
                    this.VisitMethodCall(call, fieldName);
                else
                    this.MyVisitMember(ue.Operand as MemberExpression,fieldName);
            }
            else
            {
                parameters.Add(fieldName, new Parameter(ParamPrefix + fieldName, null));
                var constant = node.Expression as ConstantExpression;
                if (constant != null)
                    VisitConstant(constant, fieldName);
                else
                {
                    LambdaExpression lambda = Expression.Lambda(node.Expression);
                    var fn = lambda.Compile();
                    VisitConstant(Expression.Constant(fn.DynamicInvoke(null), node.Expression.Type), fieldName);
                }
            }
            return node;
        }
开发者ID:yaozd,项目名称:YOYOFx,代码行数:35,代码来源:FieldsFormater.cs


示例2: UpdateMemberAssignment

 protected MemberAssignment UpdateMemberAssignment(MemberAssignment assignment, MemberInfo member, Expression expression)
 {
     if (expression != assignment.Expression || member != assignment.Member) {
         return Expression.Bind(member, expression);
     }
     return assignment;
 }
开发者ID:kpfaulkner,项目名称:Linq-To-Search,代码行数:7,代码来源:ExpressionVisitor.cs


示例3: VisitMemberAssignment

        protected override MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
        {
            var property = assignment.Member as PropertyInfo;
            if (property == null)
            {
                throw new NotSupportedException(
                    String.Format("{0} is not a property.", assignment.Member));
            }

            IPropertyUpdate update;
            var expr = PartialEval(assignment.Expression);
            switch (expr.NodeType)
            {
                case ExpressionType.Constant:
                    update = ConstantUpdate.Create(property, (ConstantExpression)expr);
                    break;
                case ExpressionType.Add:
                case ExpressionType.Subtract:
                    update = BinaryUpdate.Create(property, (BinaryExpression)expr);
                    break;
                case ExpressionType.Call:
                    update = MethodCallUpdate.Create(property, (MethodCallExpression)expr);
                    break;
                default:
                    throw new NotSupportedException();
            }

            this.m_updates.Add(update);

            return assignment;
        }
开发者ID:jefth,项目名称:EasyMongo,代码行数:31,代码来源:UpdateCollector.cs


示例4: VisitMemberAssignment

		protected override MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
		{
			this.output.Append(assignment.Member.Name).Append(" = ");
			this.Visit(assignment.Expression);

			return assignment;
		}
开发者ID:tumtumtum,项目名称:Shaolinq,代码行数:7,代码来源:ProjectorFormatter.cs


示例5: VisitMemberAssignment

 protected override MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
 {
     var saveMember = this.currentMember;
     this.currentMember = assignment.Member;
     Expression e = this.Visit(assignment.Expression);
     this.currentMember = saveMember;
     return this.UpdateMemberAssignment(assignment, assignment.Member, e);
 }
开发者ID:RukaiYu,项目名称:EnterpriseDevelopmentFx,代码行数:8,代码来源:ClientJoinedProjectionRewriter.cs


示例6: VisitMemberAssignment

        protected override MemberAssignment VisitMemberAssignment(MemberAssignment node)
        {
            var constantValue = node.Expression as ConstantExpression;
            if (constantValue != null)
            {
                _updateBuilder.Set(String.Join(".", _assigments.Reverse().ToArray()), BsonValue.Create(constantValue.Value));
            }
            else
            {
                return base.VisitMemberAssignment(node);
            }

            return node;
        }
开发者ID:kolupaev,项目名称:mongo-csharp-driver,代码行数:14,代码来源:UpdateExpressionVisitor.cs


示例7: VisitMemberAssignment

 /// <summary>
 /// Visits a MemberAssignment.
 /// </summary>
 /// <param name="node">The MemberAssignment.</param>
 /// <returns>The MemberAssignment (possibly modified).</returns>
 protected virtual MemberAssignment VisitMemberAssignment(MemberAssignment node)
 {
     Expression e = Visit(node.Expression);
     return UpdateMemberAssignment(node, node.Member, e);
 }
开发者ID:sprucemedia,项目名称:oinq,代码行数:10,代码来源:ExpressionVisitor.cs


示例8: MemberAssignmentNode

 public MemberAssignmentNode(INodeFactory factory, MemberAssignment memberAssignment)
     : base(factory, memberAssignment.BindingType, memberAssignment.Member)
 {
     this.Expression = this.Factory.Create(memberAssignment.Expression);
 }
开发者ID:jonparker,项目名称:Serialize.Linq,代码行数:5,代码来源:MemberAssignmentNode.cs


示例9: VisitMemberAssignment

 protected virtual MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
 {
     System.Linq.Expressions.Expression e = Visit(assignment.Expression);
     if(e != assignment.Expression)
     {
         return System.Linq.Expressions.Expression.Bind(assignment.Member, e);
     }
     return assignment;
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:9,代码来源:ExpressionVisitor.cs


示例10: VisitMemberAssignment

 protected override MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
 {
     this.Write(assignment.Member.Name);
     this.Write(" = ");
     this.Visit(assignment.Expression);
     return assignment;
 }
开发者ID:PaybackMan,项目名称:Cinder,代码行数:7,代码来源:ExpressionWriter.cs


示例11: VisitMemberAssignment

        /// <summary>
        /// Visit a member assignment expression.
        /// </summary>
        /// <param name="assignmentExp"></param>
        /// <returns></returns>
        protected virtual MemberAssignment VisitMemberAssignment(MemberAssignment assignmentExp)
        {
            Expression e = Visit(assignmentExp.Expression);

            return e != assignmentExp.Expression ? Expression.Bind(assignmentExp.Member, e) : assignmentExp;
        }
开发者ID:jd-pantheon,项目名称:Titan-Framework-v2,代码行数:11,代码来源:ExpressionVisitor.cs


示例12: VisitMemberAssignment

        /// <summary>
        /// Visit a member assignment expression.
        /// </summary>
        /// <param name="assignmentExp"></param>
        /// <returns></returns>
        protected virtual MemberAssignment VisitMemberAssignment(MemberAssignment assignmentExp)
        {
            Expression e = Visit(assignmentExp.Expression);

            if (e != assignmentExp.Expression)
            {
                return Expression.Bind(assignmentExp.Member, e);
            }

            return assignmentExp;
        }
开发者ID:RebelCMS,项目名称:rebelcmsxu5,代码行数:16,代码来源:ExpressionVisitor.cs


示例13: CompareMemberAssignment

 protected virtual bool CompareMemberAssignment(MemberAssignment a, MemberAssignment b)
 {
     return a.Member == b.Member
         && this.Compare(a.Expression, b.Expression);
 }
开发者ID:hamdouchi97,项目名称:Stump.ORM,代码行数:5,代码来源:ExpressionComparer.cs


示例14: VisitMemberAssignment

 protected override MemberBinding VisitMemberAssignment(MemberAssignment memberAssigment)
 {
     CheckAndVisitMemberAssignment (memberAssigment.Member, memberAssigment.Expression);
       return memberAssigment;
 }
开发者ID:nicocrm,项目名称:DotNetSDataClient,代码行数:5,代码来源:AccessorFindingExpressionTreeVisitor.cs


示例15: VisitMemberAssignment

 protected virtual MemberAssignment VisitMemberAssignment(MemberAssignment assignment, Stack<string> stack, Stack<IElasticPropertyAttribute> properties)
 {
     Expression e = this.Visit(assignment.Expression, stack, properties);
     if (e != assignment.Expression)
     {
         return Expression.Bind(assignment.Member, e);
     }
     return assignment;
 }
开发者ID:herqueles3,项目名称:elasticsearch-net,代码行数:9,代码来源:ExpressionVisitor.cs


示例16: VisitMemberAssignment

        protected override MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
        {
            this.Visit(assignment.Expression);

            switch (assignment.Member.MemberType)
            {
                case MemberTypes.Field:
                    Console.WriteLine("stfld " + assignment.Member);
                    generator.Emit(OpCodes.Stfld, (FieldInfo)assignment.Member);
                    break;
                case MemberTypes.Property:
                    var method = ((PropertyInfo)assignment.Member).GetSetMethod();
                    Console.WriteLine("callvirt {0} {1}", method.DeclaringType.Name, method.Name);
                    generator.Emit(OpCodes.Callvirt, ((PropertyInfo)assignment.Member).GetSetMethod());
                    break;
                default:
                    throw new NotSupportedException("Unsupported member assignment type: " + assignment.Member.MemberType);
            }

            return assignment;
        }
开发者ID:Refactoring,项目名称:Platform,代码行数:21,代码来源:LambdaExpressionCompilerWithMemberPopulateSupport.cs


示例17: EditableMemberAssignment

 public EditableMemberAssignment(MemberAssignment member)
     : base(member.BindingType, member.Member)
 {
     Expression = EditableExpression.Create(member.Expression);
 }
开发者ID:juanplopes,项目名称:simple,代码行数:5,代码来源:EditableMemberAssignment.cs


示例18: IsEvaluatableMemberAssignment

    public virtual bool IsEvaluatableMemberAssignment (MemberAssignment node)
    {
      ArgumentUtility.CheckNotNull ("node", node);

      return true;
    }
开发者ID:natemcmaster,项目名称:Relinq,代码行数:6,代码来源:EvaluatableExpressionFilterBase.cs


示例19: VisitMemberAssignment

 /// <summary>
 /// Visits a MemberAssignment.
 /// </summary>
 /// <param name="node">The MemberAssignment.</param>
 /// <returns>The MemberAssignment.</returns>
 protected override MemberAssignment VisitMemberAssignment(MemberAssignment node)
 {
     _sb.Append("<MemberAssignment>");
     return node;
 }
开发者ID:Bogdan0x400,项目名称:mongo-csharp-driver,代码行数:10,代码来源:ExpressionFormatter.cs


示例20: VisitMemberAssignment

 internal virtual MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
 {
     Expression expression = this.Visit(assignment.Expression);
     if (expression == assignment.Expression)
     {
         return assignment;
     }
     return Expression.Bind(assignment.Member, expression);
 }
开发者ID:nickchal,项目名称:pash,代码行数:9,代码来源:ALinqExpressionVisitor.cs



注:本文中的System.Linq.Expressions.MemberAssignment类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Expressions.MemberBinding类代码示例发布时间:2022-05-26
下一篇:
C# Expressions.ListInitExpression类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap