Ejemplo n.º 1
0
 public static bool RequiresMessage(this Delegate del, IWhenDoMessage message)
 {
     foreach (var parameter in del.Method.GetParameters())
     {
         if (parameter.ParameterType.Name == message.GetType().Name)
         {
             return(true);
         }
     }
     return(false);
 }
        private List <IWhenDoExpressionProvider> GetExpressionProviderInstancesForDelegate(Delegate del, IWhenDoMessage message)
        {
            var providers = new List <IWhenDoExpressionProvider>();
            var fullNames = del.ExtractProviderFullNames();

            foreach (var name in fullNames)
            {
                if (message != null && name.Equals(message.GetType().Name))
                {
                    providers.Add(message);
                }
                else
                {
                    var instance = registry.GetExpressionProviderInstance(name);
                    if (instance != null)
                    {
                        providers.Add(instance);
                    }
                }
            }
            return(providers);
        }