Exemple #1
0
        public void Subscribe(Action <T> processor, ListeningPriority priority = ListeningPriority.Normal)
        {
            if (!processors.ContainsKey(priority))
            {
                processors.Add(priority, new List <Action <T> >());
            }

            if (!processors.Values.Any(p => p.Contains(processor)))
            {
                processors[priority].Add(processor);
            }
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="handler"></param>
 public static void SubscribeMessage <T>(Action <T> handler, ListeningPriority priority = ListeningPriority.Normal)
     where T : MessageBase
 {
     GetMessageAggregator <T>().Subscribe(handler, priority);
 }