Пример #1
0
        private void BuildFilteredList()
        {
            SkillEvent.SanityCheckEventList();
            this.UpdateUseCount();
            List <SkillEvent> list;

            switch (this.searchBox.SearchMode)
            {
            case 0:
                list = new List <SkillEvent>(SkillEvent.get_EventList());
                break;

            case 1:
                list = Enumerable.ToList <SkillEvent>(Enumerable.Where <SkillEvent>(SkillEvent.get_EventList(), (SkillEvent p) => p.get_IsGlobal()));
                break;

            case 2:
                list = Enumerable.ToList <SkillEvent>(Enumerable.Where <SkillEvent>(SkillEvent.get_EventList(), (SkillEvent p) => !p.get_IsGlobal()));
                break;

            case 3:
                list = Enumerable.ToList <SkillEvent>(Enumerable.Where <SkillEvent>(SkillEvent.get_EventList(), (SkillEvent p) => p.get_IsSystemEvent()));
                break;

            default:
                list = new List <SkillEvent>(SkillEvent.get_EventList());
                break;
            }
            if (string.IsNullOrEmpty(this.searchString))
            {
                this.filteredEvents = new List <SkillEvent>(list);
                this.filteredEvents.Sort();
                return;
            }
            this.filteredEvents.Clear();
            string text = this.searchString.ToUpper();

            using (List <SkillEvent> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SkillEvent current = enumerator.get_Current();
                    if (current.get_Name().ToUpper().Contains(text))
                    {
                        this.filteredEvents.Add(current);
                    }
                }
            }
            this.filteredEvents.Sort();
        }