private void NewFilterGroup(string op, bool start = false) { FilterBlock newfilter = new FilterBlock(" ( " + op + " ", FILTER_GROUPS.OPEN); if (start) { InsertGroup(start, newfilter); } else { if ((GroupsCount == 0) && (AddedFilters.Count > 0)) { FilterBlock openfilter = new FilterBlock(" ( & ", FILTER_GROUPS.OPEN); InsertGroup(true, openfilter); } InsertGroup(false, newfilter); } SetFilterText(); UpdateCMDGroup(); }
private void InsertGroup(bool start, FilterBlock newFilter) { if (start) { AddedFilters.Insert(0, newFilter); } else { AddedFilters.Add(newFilter); } GroupsCount++; }
private void UnDoFilter() { if (AddedFilters.Count > 0) { FilterBlock curfilter = AddedFilters.Last(); GroupsCount += curfilter.CounterHandle; AddedFilters.Remove(curfilter); if ((GroupsCount == 1) && (AddedFilters.Count == 2)) { GroupsCount = 0; AddedFilters.RemoveAt(0); } SetFilterText(); } this.cmdUnDo.Enabled = (AddedFilters.Count > 0); UpdateCMDGroup(); }