Ejemplo n.º 1
0
        public void InitEventCountList(bool orderByCount = true)
        {
            var map = new Dictionary <string, EventCount>();

            foreach (var e in this)
            {
                EventCount ec;
                if (map.TryGetValue(e.Event, out ec))
                {
                    ec.Count++;
                }
                else
                {
                    ec           = new EventCount(e.Event, 1);
                    map[e.Event] = ec;
                }
            }

            if (orderByCount)
            {
                _eventCountList = (from ec in map.Values
                                   orderby ec.Count descending
                                   select ec).ToList();
            }
            else
            {
                _eventCountList = (from ec in map.Values
                                   orderby ec.Event
                                   select ec).ToList();
            }
        }
Ejemplo n.º 2
0
        public void InitEventCountList(int minimumMappingQuality, bool orderByCount = true)
        {
            var map = new Dictionary <string, EventCount>();

            foreach (var e in this)
            {
                if (!e.PassScoreFilter(minimumMappingQuality))
                {
                    continue;
                }

                EventCount ec;
                if (map.TryGetValue(e.Event, out ec))
                {
                    ec.Count++;
                }
                else
                {
                    ec           = new EventCount(e.Event, 1);
                    map[e.Event] = ec;
                }
            }

            if (orderByCount)
            {
                _eventCountList = (from ec in map.Values
                                   orderby ec.Count descending
                                   select ec).ToList();
            }
            else
            {
                _eventCountList = (from ec in map.Values
                                   orderby ec.Event
                                   select ec).ToList();
            }
        }