Ejemplo n.º 1
0
 /// <summary>
 /// Invokes the method and wrap.
 /// </summary>
 /// <typeparam name="TWrapper">The type of the wrapper.</typeparam>
 /// <param name="wrappedObject">The wrapped object.</param>
 /// <param name="methodInfo">The method info.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="beforeEvent">The before event.</param>
 /// <param name="afterEvent">The after event.</param>
 /// <param name="beforeEventArgs">The before event args.</param>
 /// <param name="afterEventArgs">The after event args.</param>
 /// <returns>Result of the method wrapped using the specified wrapper.</returns>
 public static TWrapper InvokeMethodAndWrap <TWrapper>(IWrappedObject wrappedObject, MethodInfo methodInfo, object[] parameters, MethodInfo beforeEvent, MethodInfo afterEvent, ConstructorInfo beforeEventArgs, ConstructorInfo afterEventArgs)
     where TWrapper : IWrappedObject
 {
     return(InvokeMethodAndWrap <TWrapper>(wrappedObject, methodInfo, parameters, PlatformHelper.EmptyTypes, beforeEvent, afterEvent, beforeEventArgs, afterEventArgs));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Invokes the method and wraps the result using the specified wrapper type.
 /// </summary>
 /// <typeparam name="TWrapper">The type of the wrapper.</typeparam>
 /// <param name="wrappedObject">The wrapped object.</param>
 /// <param name="methodInfo">The method info.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns>Result of the method wrapped using the specified wrapper.</returns>
 public static TWrapper InvokeMethodAndWrap <TWrapper>(IWrappedObject wrappedObject, MethodInfo methodInfo, object[] parameters)
     where TWrapper : IWrappedObject
 {
     return(InvokeMethodAndWrap <TWrapper>(wrappedObject, methodInfo, parameters, PlatformHelper.EmptyTypes));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Invokes the method and cast.
 /// </summary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="wrappedObject">The wrapped object.</param>
 /// <param name="methodInfo">The method info.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="typeArguments">The type arguments.</param>
 /// <param name="beforeEvent">The before event.</param>
 /// <param name="afterEvent">The after event.</param>
 /// <param name="beforeEventArgs">The before event args.</param>
 /// <param name="afterEventArgs">The after event args.</param>
 /// <returns>Result of the method cast to the specific type.</returns>
 public static TResult InvokeMethodAndCast <TResult>(IWrappedObject wrappedObject, MethodInfo methodInfo, object[] parameters, Type[] typeArguments, MethodInfo beforeEvent, MethodInfo afterEvent, ConstructorInfo beforeEventArgs, ConstructorInfo afterEventArgs)
 {
     return((TResult)InvokeMethod(wrappedObject, methodInfo, parameters, typeArguments, beforeEvent, afterEvent, beforeEventArgs, afterEventArgs));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Invokes the method and casts the result to the specified type.
 /// </summary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="wrappedObject">The wrapped object.</param>
 /// <param name="methodInfo">The method info.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="typeArguments">The type arguments.</param>
 /// <returns>Result of the method cast to the specified type.</returns>
 public static TResult InvokeMethodAndCast <TResult>(IWrappedObject wrappedObject, MethodInfo methodInfo, object[] parameters, Type[] typeArguments)
 {
     return((TResult)InvokeMethod(wrappedObject, methodInfo, parameters, typeArguments));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Invokes the method and cast.
 /// </summary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="wrappedObject">The wrapped object.</param>
 /// <param name="methodInfo">The method info.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="beforeEvent">The before event.</param>
 /// <param name="afterEvent">The after event.</param>
 /// <param name="beforeEventArgs">The before event args.</param>
 /// <param name="afterEventArgs">The after event args.</param>
 /// <returns>Result of the method cast to the specific type.</returns>
 public static TResult InvokeMethodAndCast <TResult>(IWrappedObject wrappedObject, MethodInfo methodInfo, object[] parameters, MethodInfo beforeEvent, MethodInfo afterEvent, ConstructorInfo beforeEventArgs, ConstructorInfo afterEventArgs)
 {
     return(InvokeMethodAndCast <TResult>(wrappedObject, methodInfo, parameters, PlatformHelper.EmptyTypes, beforeEvent, afterEvent, beforeEventArgs, afterEventArgs));
 }
Ejemplo n.º 6
0
 public WrappedObject(IWrappedObject wrap)
 {
     _wrap = wrap;
 }