Skip to content

Commit 8e834c8

Browse files
authored
Merge pull request #9194 from steveharter/UpdateInvoker
Port MethodInvoker and ConstructorInvoker doc
2 parents 883a78b + 8bf74cc commit 8e834c8

2 files changed

Lines changed: 72 additions & 45 deletions

File tree

xml/System.Reflection/ConstructorInvoker.xml

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
</Attribute>
2525
</Attributes>
2626
<Docs>
27-
<summary>To be added.</summary>
28-
<remarks>To be added.</remarks>
27+
<summary>Provides methods to invoke the method specified by the provided <see cref="T:System.Reflection.ConstructorInfo" />.</summary>
28+
<remarks>This class provides better performance than <see cref="M:System.Reflection.ConstructorInfo.Invoke(System.Object[])" /> when compatibility with that method is not necessary and when the caller can cache the ConstructorInvoker instance for additional invoke calls. Unlike <see cref="M:System.Reflection.ConstructorInfo.Invoke(System.Object[])" />, the invoke methods in this class don't look up default values for arguments when <see cref="F:System.Type.Missing" /> is specified. In addition, the target constructor may be inlined for performance and not appear in stack traces.</remarks>
2929
</Docs>
3030
<Members>
3131
<Member MemberName="Create">
@@ -53,10 +53,11 @@
5353
<Parameter Name="constructor" Type="System.Reflection.ConstructorInfo" />
5454
</Parameters>
5555
<Docs>
56-
<param name="constructor">To be added.</param>
57-
<summary>To be added.</summary>
58-
<returns>To be added.</returns>
59-
<remarks>To be added.</remarks>
56+
<param name="constructor">The constructor that will be invoked.</param>
57+
<summary>Creates a new instance of <see cref="T:System.Reflection.ConstructorInvoker" />.</summary>
58+
<returns>The new instance.</returns>
59+
<remarks>For performance, the resulting instance should be cached for additional calls.</remarks>
60+
<exception cref="T:System.ArgumentException">The <paramref name="constructor" /> is not a runtime-based method.</exception>
6061
</Docs>
6162
</Member>
6263
<Member MemberName="Invoke">
@@ -76,9 +77,12 @@
7677
</ReturnValue>
7778
<Parameters />
7879
<Docs>
79-
<summary>To be added.</summary>
80-
<returns>To be added.</returns>
80+
<summary>Invokes the constructor.</summary>
81+
<returns>An instance of the class associated with the constructor.</returns>
8182
<remarks>To be added.</remarks>
83+
<exception cref="T:System.InvalidOperationException">The type that declares the method is an open generic type.</exception>
84+
<exception cref="T:System.Reflection.TargetParameterCountException">An incorrect number of arguments was provided.</exception>
85+
<exception cref="T:System.NotSupportedException">The calling convention or signature is not supported.</exception>
8286
</Docs>
8387
</Member>
8488
<Member MemberName="Invoke">
@@ -100,10 +104,12 @@
100104
<Parameter Name="arg1" Type="System.Object" />
101105
</Parameters>
102106
<Docs>
103-
<param name="arg1">To be added.</param>
104-
<summary>To be added.</summary>
107+
<param name="arg1">The first argument for the invoked method.</param>
108+
<summary>Invokes the constructor using the specified arguments.</summary>
105109
<returns>To be added.</returns>
106110
<remarks>To be added.</remarks>
111+
<inheritdoc cref="M:System.Reflection.ConstructorInvoker.Invoke" />
112+
<exception cref="T:System.ArgumentException">The arguments do not match the signature of the invoked constructor.</exception>
107113
</Docs>
108114
</Member>
109115
<Member MemberName="Invoke">
@@ -132,10 +138,12 @@
132138
</Parameter>
133139
</Parameters>
134140
<Docs>
135-
<param name="arguments">To be added.</param>
141+
<param name="arguments">The arguments for the invoked constructor.</param>
136142
<summary>To be added.</summary>
137143
<returns>To be added.</returns>
138144
<remarks>To be added.</remarks>
145+
<inheritdoc cref="M:System.Reflection.ConstructorInvoker.Invoke(System.Object)" />
146+
<exception cref="T:System.ArgumentException">The arguments do not match the signature of the invoked constructor.</exception>
139147
</Docs>
140148
</Member>
141149
<Member MemberName="Invoke">
@@ -158,11 +166,12 @@
158166
<Parameter Name="arg2" Type="System.Object" />
159167
</Parameters>
160168
<Docs>
161-
<param name="arg1">To be added.</param>
162-
<param name="arg2">To be added.</param>
169+
<param name="arg1">The first argument for the invoked method.</param>
170+
<param name="arg2">The second argument for the invoked method.</param>
163171
<summary>To be added.</summary>
164172
<returns>To be added.</returns>
165173
<remarks>To be added.</remarks>
174+
<inheritdoc cref="M:System.Reflection.ConstructorInvoker.Invoke(System.Object)" />
166175
</Docs>
167176
</Member>
168177
<Member MemberName="Invoke">
@@ -186,12 +195,13 @@
186195
<Parameter Name="arg3" Type="System.Object" />
187196
</Parameters>
188197
<Docs>
189-
<param name="arg1">To be added.</param>
190-
<param name="arg2">To be added.</param>
191-
<param name="arg3">To be added.</param>
198+
<param name="arg1">The first argument for the invoked method.</param>
199+
<param name="arg2">The second argument for the invoked method.</param>
200+
<param name="arg3">The third argument for the invoked method.</param>
192201
<summary>To be added.</summary>
193202
<returns>To be added.</returns>
194203
<remarks>To be added.</remarks>
204+
<inheritdoc cref="M:System.Reflection.ConstructorInvoker.Invoke(System.Object)" />
195205
</Docs>
196206
</Member>
197207
<Member MemberName="Invoke">
@@ -216,13 +226,14 @@
216226
<Parameter Name="arg4" Type="System.Object" />
217227
</Parameters>
218228
<Docs>
219-
<param name="arg1">To be added.</param>
220-
<param name="arg2">To be added.</param>
221-
<param name="arg3">To be added.</param>
222-
<param name="arg4">To be added.</param>
229+
<param name="arg1">The first argument for the invoked method.</param>
230+
<param name="arg2">The second argument for the invoked method.</param>
231+
<param name="arg3">The third argument for the invoked method.</param>
232+
<param name="arg4">The fourth argument for the invoked method.</param>
223233
<summary>To be added.</summary>
224234
<returns>To be added.</returns>
225235
<remarks>To be added.</remarks>
236+
<inheritdoc cref="M:System.Reflection.ConstructorInvoker.Invoke(System.Object)" />
226237
</Docs>
227238
</Member>
228239
</Members>

xml/System.Reflection/MethodInvoker.xml

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
</Attribute>
2525
</Attributes>
2626
<Docs>
27-
<summary>To be added.</summary>
28-
<remarks>To be added.</remarks>
27+
<summary>Provides methods to invoke the method specified by the provided <see cref="T:System.Reflection.MethodBase" />.</summary>
28+
<remarks>The methods in this class provide better performance than <see cref="M:System.Reflection.MethodBase.Invoke(System.Object,System.Object[])" /> when compatibility with that method isn't necessary and when the caller can cache the MethodInvoker instance for additional invoke calls. Unlike <see cref="M:System.Reflection.MethodBase.Invoke(System.Object,System.Object[])" />, the invoke methods in this class don't look up default values for arguments when <see cref="F:System.Type.Missing" /> is specified. In addition, the target method may be inlined for performance and not appear in stack traces.</remarks>
2929
</Docs>
3030
<Members>
3131
<Member MemberName="Create">
@@ -53,10 +53,11 @@
5353
<Parameter Name="method" Type="System.Reflection.MethodBase" />
5454
</Parameters>
5555
<Docs>
56-
<param name="method">To be added.</param>
57-
<summary>To be added.</summary>
58-
<returns>To be added.</returns>
59-
<remarks>To be added.</remarks>
56+
<param name="method">The method that will be invoked.</param>
57+
<summary>Creates a new instance of <see cref="T:System.Reflection.MethodInvoker" />.</summary>
58+
<returns>The new instance.</returns>
59+
<remarks>For performance, the resulting instance should be cached for additional calls.</remarks>
60+
<exception cref="T:System.ArgumentException">The <paramref name="method" /> is not a runtime-based method.</exception>
6061
</Docs>
6162
</Member>
6263
<Member MemberName="Invoke">
@@ -78,10 +79,18 @@
7879
<Parameter Name="obj" Type="System.Object" />
7980
</Parameters>
8081
<Docs>
81-
<param name="obj">To be added.</param>
82-
<summary>To be added.</summary>
83-
<returns>To be added.</returns>
82+
<param name="obj">The object on which to invoke the method. If the method is static, this argument is ignored.</param>
83+
<summary>Invokes the method using the specified arguments.</summary>
84+
<returns>An object containing the return value of the invoked method, or <see langword="null" /> if the invoked method does not have a return value.</returns>
8485
<remarks>To be added.</remarks>
86+
<exception cref="T:System.Reflection.TargetException">The <paramref name="obj" /> argument is <see langword="null" /> and the method is not static.
87+
88+
-or-
89+
90+
The method is not declared or inherited by the class of <paramref name="obj" />.</exception>
91+
<exception cref="T:System.InvalidOperationException">The type that declares the method is an open generic type.</exception>
92+
<exception cref="T:System.Reflection.TargetParameterCountException">An incorrect number of arguments was provided.</exception>
93+
<exception cref="T:System.NotSupportedException">The calling convention or signature is not supported.</exception>
8594
</Docs>
8695
</Member>
8796
<Member MemberName="Invoke">
@@ -104,11 +113,13 @@
104113
<Parameter Name="arg1" Type="System.Object" />
105114
</Parameters>
106115
<Docs>
107-
<param name="obj">To be added.</param>
108-
<param name="arg1">To be added.</param>
116+
<param name="obj">The object on which to invoke the method. If the method is static, this argument is ignored.</param>
117+
<param name="arg1">The first argument for the invoked method.</param>
109118
<summary>To be added.</summary>
110119
<returns>To be added.</returns>
111120
<remarks>To be added.</remarks>
121+
<inheritdoc cref="M:System.Reflection.MethodInvoker.Invoke(System.Object)" />
122+
<exception cref="T:System.ArgumentException">The arguments do not match the signature of the invoked method.</exception>
112123
</Docs>
113124
</Member>
114125
<Member MemberName="Invoke">
@@ -138,11 +149,13 @@
138149
</Parameter>
139150
</Parameters>
140151
<Docs>
141-
<param name="obj">To be added.</param>
142-
<param name="arguments">To be added.</param>
152+
<param name="obj">The object on which to invoke the method. If the method is static, this argument is ignored.</param>
153+
<param name="arguments">The arguments for the invoked method.</param>
143154
<summary>To be added.</summary>
144155
<returns>To be added.</returns>
145156
<remarks>To be added.</remarks>
157+
<inheritdoc cref="M:System.Reflection.MethodInvoker.Invoke(System.Object)" />
158+
<exception cref="T:System.ArgumentException">The arguments do not match the signature of the invoked method.</exception>
146159
</Docs>
147160
</Member>
148161
<Member MemberName="Invoke">
@@ -166,12 +179,13 @@
166179
<Parameter Name="arg2" Type="System.Object" />
167180
</Parameters>
168181
<Docs>
169-
<param name="obj">To be added.</param>
170-
<param name="arg1">To be added.</param>
171-
<param name="arg2">To be added.</param>
182+
<param name="obj">The object on which to invoke the method. If the method is static, this argument is ignored.</param>
183+
<param name="arg1">The first argument for the invoked method.</param>
184+
<param name="arg2">The second argument for the invoked method.</param>
172185
<summary>To be added.</summary>
173186
<returns>To be added.</returns>
174187
<remarks>To be added.</remarks>
188+
<inheritdoc cref="M:System.Reflection.MethodInvoker.Invoke(System.Object)" />
175189
</Docs>
176190
</Member>
177191
<Member MemberName="Invoke">
@@ -196,13 +210,14 @@
196210
<Parameter Name="arg3" Type="System.Object" />
197211
</Parameters>
198212
<Docs>
199-
<param name="obj">To be added.</param>
200-
<param name="arg1">To be added.</param>
201-
<param name="arg2">To be added.</param>
202-
<param name="arg3">To be added.</param>
213+
<param name="obj">The object on which to invoke the method. If the method is static, this argument is ignored.</param>
214+
<param name="arg1">The first argument for the invoked method.</param>
215+
<param name="arg2">The second argument for the invoked method.</param>
216+
<param name="arg3">The third argument for the invoked method.</param>
203217
<summary>To be added.</summary>
204218
<returns>To be added.</returns>
205219
<remarks>To be added.</remarks>
220+
<inheritdoc cref="M:System.Reflection.MethodInvoker.Invoke(System.Object)" />
206221
</Docs>
207222
</Member>
208223
<Member MemberName="Invoke">
@@ -228,14 +243,15 @@
228243
<Parameter Name="arg4" Type="System.Object" />
229244
</Parameters>
230245
<Docs>
231-
<param name="obj">To be added.</param>
232-
<param name="arg1">To be added.</param>
233-
<param name="arg2">To be added.</param>
234-
<param name="arg3">To be added.</param>
235-
<param name="arg4">To be added.</param>
246+
<param name="obj">The object on which to invoke the method. If the method is static, this argument is ignored.</param>
247+
<param name="arg1">The first argument for the invoked method.</param>
248+
<param name="arg2">The second argument for the invoked method.</param>
249+
<param name="arg3">The third argument for the invoked method.</param>
250+
<param name="arg4">The fourth argument for the invoked method.</param>
236251
<summary>To be added.</summary>
237252
<returns>To be added.</returns>
238253
<remarks>To be added.</remarks>
254+
<inheritdoc cref="M:System.Reflection.MethodInvoker.Invoke(System.Object)" />
239255
</Docs>
240256
</Member>
241257
</Members>

0 commit comments

Comments
 (0)