当前位置: 首页>>代码示例>>C#>>正文


C# Expressions.ElementInit类代码示例

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


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


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