private void AddArgumentProcessor(MemberInfo memberInfo)
{
if (argumentProcessor != null)
throw new NotSupportedException("More than one argument processor method found");
if ((memberInfo.MemberType == MemberTypes.Method && memberInfo is MethodInfo))
{
if (((MethodInfo) memberInfo).ReturnType.FullName != typeof(void).FullName)
throw new NotSupportedException("Argument processor method must return 'void'");
ParameterInfo[] parameters = ((MethodInfo) memberInfo).GetParameters();
if ((parameters == null) || (parameters.Length != 1) ||
(parameters[0].ParameterType.FullName != typeof(string).FullName))
throw new NotSupportedException("Argument processor method must have a string parameter");
argumentProcessor = (MethodInfo) memberInfo;
}
else
throw new NotSupportedException("Argument processor marked member isn't a method");
}