AspectSharp.Tests.Classes.LogInvocationInterceptor.Invoke C# (CSharp) Method

Invoke() public method

public Invoke ( IMethodInvocation invocation ) : object
invocation IMethodInvocation
return object
		public object Invoke(IMethodInvocation invocation)
		{
			MethodBase method = invocation.Method;
			
			if (method.IsSpecialName)
			{
				_list.Add("property " + method.Name);
			}
			else
			{
				Type[] args = Type.GetTypeArray(invocation.Arguments);

				String argMessage = "(";
				foreach(Type arg in args)
				{
					argMessage += " " + arg.Name;
				}
				argMessage += ")";
				
				_list.Add("method " + method.Name + argMessage);
			}

			return invocation.Proceed();
		}
	}