/// <summary>
        ///     Builds a CommandListener class based on the class type
        /// </summary>
        /// <param name="classType"></param>
        private void BuildCommandListener(Type classType)
        {
            var methods = classType.GetMethods();

            foreach (var methodInfo in methods)
            {
                var commandAttribute = methodInfo.GetCustomAttribute <CommandAttribute>();
                if (commandAttribute == null)
                {
                    continue;
                }

                var firstParam = GetParameterInfo(methodInfo);
                var returnType = methodInfo.ReturnType;

                var methodCommandInfo = new MethodCommandInfo(classType, methodInfo, firstParam, returnType,
                                                              commandAttribute.Queuename);
                var commandListener = new CommandListener(methodCommandInfo);

                _commandListeners.Add(commandListener);
            }
        }
Ejemplo n.º 2
0
 public CommandListener(MethodCommandInfo methodCommandInfo)
 {
     _methodCommandInfo = methodCommandInfo;
     QueueName          = _methodCommandInfo.QueueName;
 }