mscorlib(4.0.0.0) API with additions
CallInfo.cs
3 using System.Dynamic.Utils;
5 
6 namespace System.Dynamic
7 {
9  [global::__DynamicallyInvokable]
10  public sealed class CallInfo
11  {
12  private readonly int _argCount;
13 
14  private readonly ReadOnlyCollection<string> _argNames;
15 
18  [global::__DynamicallyInvokable]
19  public int ArgumentCount
20  {
21  [global::__DynamicallyInvokable]
22  get
23  {
24  return _argCount;
25  }
26  }
27 
30  [global::__DynamicallyInvokable]
32  {
33  [global::__DynamicallyInvokable]
34  get
35  {
36  return _argNames;
37  }
38  }
39 
43  [global::__DynamicallyInvokable]
44  public CallInfo(int argCount, params string[] argNames)
45  : this(argCount, (IEnumerable<string>)argNames)
46  {
47  }
48 
52  [global::__DynamicallyInvokable]
53  public CallInfo(int argCount, IEnumerable<string> argNames)
54  {
55  ContractUtils.RequiresNotNull(argNames, "argNames");
56  ReadOnlyCollection<string> readOnlyCollection = argNames.ToReadOnly();
57  if (argCount < readOnlyCollection.Count)
58  {
59  throw Error.ArgCntMustBeGreaterThanNameCnt();
60  }
61  ContractUtils.RequiresNotNullItems(readOnlyCollection, "argNames");
62  _argCount = argCount;
63  _argNames = readOnlyCollection;
64  }
65 
68  [global::__DynamicallyInvokable]
69  public override int GetHashCode()
70  {
71  return _argCount ^ _argNames.ListHashCode();
72  }
73 
77  [global::__DynamicallyInvokable]
78  public override bool Equals(object obj)
79  {
80  CallInfo callInfo = obj as CallInfo;
81  if (_argCount == callInfo._argCount)
82  {
83  return _argNames.ListEquals(callInfo._argNames);
84  }
85  return false;
86  }
87  }
88 }
CallInfo(int argCount, params string[] argNames)
Creates a new PositionalArgumentInfo.
Definition: CallInfo.cs:44
Definition: __Canon.cs:3
CallInfo(int argCount, IEnumerable< string > argNames)
Creates a new CallInfo that represents arguments in the dynamic binding process.
Definition: CallInfo.cs:53
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
override bool Equals(object obj)
Determines whether the specified CallInfo instance is considered equal to the current.
Definition: CallInfo.cs:78
ReadOnlyCollection< string > ArgumentNames
The argument names.
Definition: CallInfo.cs:32
int ArgumentCount
The number of arguments.
Definition: CallInfo.cs:20
Describes arguments in the dynamic binding process.
Definition: CallInfo.cs:10
override int GetHashCode()
Serves as a hash function for the current T:System.Dynamic.CallInfo.
Definition: CallInfo.cs:69