AspectSharp.Core.Matchers.DefaultJoinPointMatcher.ArgumentsMatch C# (CSharp) Method

ArgumentsMatch() protected method

protected ArgumentsMatch ( MethodSignature signature, MethodInfo method ) : bool
signature AspectSharp.Lang.AST.MethodSignature
method System.Reflection.MethodInfo
return bool
		protected virtual bool ArgumentsMatch(MethodSignature signature, MethodInfo method)
		{
			if (signature.AllArguments)
			{
				return true;
			}

			String[] arguments = signature.Arguments;
			ParameterInfo[] parameters = method.GetParameters();

			for (int i = 0; i < arguments.Length; i++)
			{
				String argName = arguments[i];

				if (argName.Equals("*"))
				{
					break;
				}
				else if (i == parameters.Length)
				{
					return false;
				}
				else if (i == arguments.Length - 1 && arguments.Length != parameters.Length)
				{
					return false;
				}

				if (!TypeMatch(argName, parameters[i].ParameterType))
				{
					return false;
				}
			}

			return true;
		}