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

C# Expressions.ElementInit类代码示例

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

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



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

示例1: Initialize

        private void Initialize(ElementInit elementInit)
        {
            if (elementInit == null) throw new ArgumentNullException("elementInit");

            AddMethod = new MethodInfoNode(Context, elementInit.AddMethod);
            Arguments = new ExpressionNodeList(Context, elementInit.Arguments);
        }
开发者ID:gulbanana,项目名称:Serialize.Linq,代码行数:7,代码来源:ElementInitNode.cs


示例2: VisitElementInit

        protected override ElementInit VisitElementInit(ElementInit node)
        {
            var args = Visit(node.Arguments);
            foreach(var arg in args)
                AddParameter(arg);

            return null;
        }
开发者ID:hazama-yuinyan,项目名称:Expresso,代码行数:8,代码来源:ParameterCollector.cs


示例3: ElementInit

 void ElementInit(ElementInit elementInit)
 {
     indent++;
     Write("Arguments:");
     foreach (var argument in elementInit.Arguments) {
         Expression(argument);
     }
     indent--;
 }
开发者ID:rogernorling,项目名称:csharp-utilities,代码行数:9,代码来源:LinqDom.cs


示例4: EditableElementInit

 public EditableElementInit(ElementInit elmInit)
     : this()
 {
     AddMethod = elmInit.AddMethod;
     foreach (Expression ex in elmInit.Arguments)
     {
         Arguments.Add(EditableExpression.Create(ex));
     }
 }
开发者ID:Cussa,项目名称:simple-commons,代码行数:9,代码来源:EditableElementInit.cs


示例5: GetInitializers

        private ElementInit[] GetInitializers(MethodInfo invoke, out ParameterExpression[] parameters)
        {
            ParameterInfo[] parameterInfos = invoke.GetParameters();
            var initializers = new ElementInit[parameterInfos.Length];
            parameters = new ParameterExpression[parameterInfos.Length];
            for (var i = 0; i < parameterInfos.Length; i++)
            {
                Expression dictionaryValue;
                Expression dictionaryKey;
                ParameterExpression parameter;

                BuildInitializer(out dictionaryValue, out dictionaryKey, out parameter, parameterInfos[i]);
                parameters[i] = parameter;
                initializers[i] = Expression.ElementInit(Tokens.DictionaryAdd, new[] { dictionaryKey, dictionaryValue });
            }
            return initializers;
        }
开发者ID:nhsevidence,项目名称:Snooze,代码行数:17,代码来源:ExpressionTreeBasedDelegateBuilder.cs


示例6: VisitElementInit

 /// <summary>
 /// Visits an ElementInit node.
 /// </summary>
 /// <param name="node">The ElementInit node.</param>
 /// <returns>The ElementInit node.</returns>
 protected override ElementInit VisitElementInit(ElementInit node)
 {
     throw new NotImplementedException();
 }
开发者ID:mpobrien,项目名称:mongo-csharp-driver,代码行数:9,代码来源:ExpressionPrettyPrinter.cs


示例7: VisitElementInit

 private static ElementInit VisitElementInit(ElementInit node)
 {
     throw new NotImplementedException();
 }
开发者ID:bryangrossman,项目名称:ZuoraMagic,代码行数:4,代码来源:ZOQLVisitor.cs


示例8: VisitElementInitializer

		protected virtual ElementInit VisitElementInitializer (ElementInit initializer)
		{
			Expression[] args;
			if (VisitExpressionList (initializer.Arguments, out args))
				return Expression.ElementInit (initializer.AddMethod, args);

			return initializer;
		}
开发者ID:kstreet,项目名称:Street.MvxPlugins,代码行数:8,代码来源:ExpressionVisitor.cs


示例9: VisitElementInitializer

 /// <summary>
 /// ElementInit visit method
 /// </summary>
 /// <param name="initializer">The ElementInit expression to visit</param>
 /// <returns>The visited ElementInit expression </returns>
 internal override ElementInit VisitElementInitializer(ElementInit initializer)
 {
     this.VisitExpressionList(initializer.Arguments);
     return initializer;
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:10,代码来源:NonClrExpressionTreeToXmlSerializer.cs


示例10: ListInit

        /// <summary>
        /// Creates a <see cref="ListInitExpression"/> that uses a specified method to add elements to a collection. 
        /// </summary>
        /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="P:ListInitExpression.NewExpression"/> property equal to.</param>
        /// <param name="addMethod">A <see cref="MethodInfo"/> that represents an instance method named "Add" (case insensitive), that adds an element to a collection. </param>
        /// <param name="initializers">An <see cref="IEnumerable{T}"/> that contains <see cref="Expression"/> objects to use to populate the Initializers collection.</param>
        /// <returns>A <see cref="ListInitExpression"/> that has the <see cref="P:ListInitExpression.NodeType"/> property equal to ListInit and the <see cref="P:ListInitExpression.NewExpression"/> property set to the specified value.</returns>
        public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo addMethod, IEnumerable<Expression> initializers)
        {
            if (addMethod == null)
            {
                return ListInit(newExpression, initializers);
            }
            ContractUtils.RequiresNotNull(newExpression, "newExpression");
            ContractUtils.RequiresNotNull(initializers, "initializers");

            var initializerlist = initializers.ToReadOnly();
            if (initializerlist.Count == 0)
            {
                throw Error.ListInitializerWithZeroMembers();
            }
            ElementInit[] initList = new ElementInit[initializerlist.Count];
            for (int i = 0; i < initializerlist.Count; i++)
            {
                initList[i] = ElementInit(addMethod, initializerlist[i]);
            }
            return ListInit(newExpression, new TrueReadOnlyCollection<ElementInit>(initList));
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:28,代码来源:ListInitExpression.cs


示例11: ElementInitNode

 public ElementInitNode(INodeFactory factory, ElementInit elementInit)
     : base(factory)
 {
     this.Initialize(elementInit);
 }
开发者ID:zapov,项目名称:Serialize.Linq,代码行数:5,代码来源:ElementInitNode.cs


示例12: SerializableElementInit

 /// <summary>
 /// Constructor with an <see cref="ElementInit"/> and an <see cref="ExpressionConverter"/>.
 /// </summary>
 /// <param name="elementInit">The original, not serializable <see cref="ElementInit"/>.</param>
 /// <param name="expConverter">The <see cref="ExpressionConverter"/> to convert contained <see cref="Expression">Expressions</see>.</param>
 public SerializableElementInit(ElementInit elementInit, ExpressionConverter expConverter)
 {
     Arguments = elementInit.Arguments.MakeSerializableCollection<SerializableExpression>(expConverter);
     AddMethod = elementInit.AddMethod;
 }
开发者ID:yallie,项目名称:zyan,代码行数:10,代码来源:SerializableElementInit.cs


示例13: VisitElementInitializer

 /// <summary>
 /// ElementInit visit method
 /// </summary>
 /// <param name="initializer">The ElementInit expression to visit</param>
 /// <returns>The visited ElementInit expression </returns>
 internal override ElementInit VisitElementInitializer(ElementInit initializer)
 {
     throw new NotImplementedException();
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:9,代码来源:ExpressionTreeToXmlSerializer.cs


示例14: VisitElementInitializer

 protected virtual void VisitElementInitializer(ElementInit initializer)
 {
     this.VisitExpressionList(initializer.Arguments);
     throw new NotImplementedException ();
 }
开发者ID:kewell-tsao,项目名称:AluminumLua,代码行数:5,代码来源:ExpressionVisitor.cs


示例15: PVisitElementInitializer

 protected virtual void PVisitElementInitializer(ElementInit initializer)
 {
 }
开发者ID:mbsky,项目名称:dotnetmarcheproject,代码行数:3,代码来源:PostfixExpressionVisitor.cs


示例16: VisitElementInitializer

 protected virtual ElementInit VisitElementInitializer(ElementInit initializer)
 {
     var arguments = VisitExpressionList(initializer.Arguments);
     return arguments != initializer.Arguments ? Expression.ElementInit(initializer.AddMethod, arguments) : initializer;
 }
开发者ID:powerinbox,项目名称:parse-dotnet,代码行数:5,代码来源:ExpressionVisitor.cs


示例17: VisitElementInitializer

		protected override void VisitElementInitializer (ElementInit initializer)
		{
			object target = null;
			if (!initializer.AddMethod.IsStatic)
				target = Pop ();

			var arguments = VisitListExpressions (initializer.Arguments);
			InvokeMethod (initializer.AddMethod, target, arguments);

			if (!initializer.AddMethod.IsStatic)
				Push (target);
		}
开发者ID:BEllis,项目名称:SpecFlow,代码行数:12,代码来源:ExpressionInterpreter.cs


示例18: VisitElementInitializer

 internal virtual ElementInit VisitElementInitializer(ElementInit initializer)
 {
     var arguments = VisitExpressionList(initializer.Arguments);
     if (arguments != initializer.Arguments)
     {
         return Expression.ElementInit(initializer.AddMethod, arguments);
     }
     return initializer;
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:9,代码来源:EntityExpressionVisitor.cs


示例19: EditableElementInit

 public EditableElementInit(ElementInit elementInit)
 {
     AddMethod = elementInit.AddMethod;
     arguments = new EditableExpressionCollection<Expression>(elementInit.Arguments);
 }
开发者ID:ramonsmits,项目名称:Umbrella,代码行数:5,代码来源:EditableElementInit.cs


示例20: IsEvaluatableElementInit

    public virtual bool IsEvaluatableElementInit (ElementInit node)
    {
      ArgumentUtility.CheckNotNull ("node", node);

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Expressions.Expression类代码示例发布时间:2022-05-26
下一篇:
C# Expressions.ConstantExpression类代码示例发布时间: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