1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.Core
.Interceptor
18 using System
.Reflection
;
21 /// New interface that is going to be used by DynamicProxy 2
23 public interface IInvocation
27 object InvocationTarget { get; }
29 Type TargetType { get; }
31 object[] Arguments { get; }
33 void SetArgumentValue(int index
, object value);
35 object GetArgumentValue(int index
);
38 /// The generic arguments of the method, or null if not a generic method.
40 Type
[] GenericArguments { get; }
45 MethodInfo Method { get; }
48 /// Returns the concrete instantiation of <see cref="Method"/>, with any generic parameters bound to real types.
50 /// <returns>The concrete instantiation of <see cref="Method"/>, or <see cref="Method"/> if not a generic method.</returns>
51 /// <remarks>Can be slower than calling <see cref="Method"/>.</remarks>
52 MethodInfo
GetConcreteMethod();
55 /// For interface proxies, this will point to the
56 /// <see cref="MethodInfo"/> on the target class
58 MethodInfo MethodInvocationTarget { get; }
61 /// Returns the concrete instantiation of <see cref="MethodInvocationTarget"/>, with any generic parameters bound to real types.
63 /// <returns>The concrete instantiation of <see cref="MethodInvocationTarget"/>, or <see cref="MethodInvocationTarget"/> if not a generic method.</returns>
64 /// <remarks>Can be slower than calling <see cref="MethodInvocationTarget"/>.</remarks>
65 MethodInfo
GetConcreteMethodInvocationTarget();
67 object ReturnValue { get; set; }
72 /// <returns></returns>