mscorlib(4.0.0.0) API with additions
ElementInit.cs
3 using System.Reflection;
4 
6 {
8  [global::__DynamicallyInvokable]
9  public sealed class ElementInit : IArgumentProvider
10  {
11  private MethodInfo _addMethod;
12 
13  private ReadOnlyCollection<Expression> _arguments;
14 
17  [global::__DynamicallyInvokable]
18  public MethodInfo AddMethod
19  {
20  [global::__DynamicallyInvokable]
21  get
22  {
23  return _addMethod;
24  }
25  }
26 
29  [global::__DynamicallyInvokable]
31  {
32  [global::__DynamicallyInvokable]
33  get
34  {
35  return _arguments;
36  }
37  }
38 
41  [global::__DynamicallyInvokable]
43  {
44  [global::__DynamicallyInvokable]
45  get
46  {
47  return _arguments.Count;
48  }
49  }
50 
51  internal ElementInit(MethodInfo addMethod, ReadOnlyCollection<Expression> arguments)
52  {
53  _addMethod = addMethod;
54  _arguments = arguments;
55  }
56 
60  [global::__DynamicallyInvokable]
61  Expression IArgumentProvider.GetArgument(int index)
62  {
63  return _arguments[index];
64  }
65 
68  [global::__DynamicallyInvokable]
69  public override string ToString()
70  {
71  return ExpressionStringBuilder.ElementInitBindingToString(this);
72  }
73 
77  [global::__DynamicallyInvokable]
79  {
80  if (arguments == Arguments)
81  {
82  return this;
83  }
84  return Expression.ElementInit(AddMethod, arguments);
85  }
86  }
87 }
Provides the base class for a generic read-only collection.
ElementInit Update(IEnumerable< Expression > arguments)
Creates a new expression that is like this one, but using the supplied children. If all of the childr...
Definition: ElementInit.cs:78
Discovers the attributes of a method and provides access to method metadata.
Definition: MethodInfo.cs:13
Provides an internal interface for accessing the arguments of multiple tree nodes (DynamicExpression,...
Definition: __Canon.cs:3
int Count
Gets the number of elements contained in the T:System.Collections.ObjectModel.ReadOnlyCollection`1 in...
Exposes the enumerator, which supports a simple iteration over a collection of a specified type....
Definition: IEnumerable.cs:9
int ArgumentCount
Returns the number of arguments to the expression tree node. You should not use this type....
ReadOnlyCollection< Expression > Arguments
Gets the collection of arguments that are passed to a method that adds an element to an T:System....
Definition: ElementInit.cs:31
Provides the base class from which the classes that represent expression tree nodes are derived....
Definition: Expression.cs:17
Represents an initializer for a single element of an T:System.Collections.IEnumerable collection.
Definition: ElementInit.cs:9
override string ToString()
Returns a textual representation of an T:System.Linq.Expressions.ElementInit object.
Definition: ElementInit.cs:69
MethodInfo AddMethod
Gets the instance method that is used to add an element to an T:System.Collections....
Definition: ElementInit.cs:19