示例#1
0
        public IMessageHandlerStats GetStats()
        {
            var total = new MessageHandlerStats("All Handlers");

            messageHandlers.ToList().ForEach(x => total.Add(x.GetStats()));
            return(total);
        }
示例#2
0
        public static IMessageHandlerStats CombineStats(this IEnumerable <IMessageHandlerStats> stats)
        {
            IMessageHandlerStats to = null;

            if (stats != null)
            {
                foreach (var stat in stats)
                {
                    if (to == null)
                    {
                        to = new MessageHandlerStats(stat.Name);
                    }

                    to.Add(stat);
                }
            }

            return(to);
        }