private bool Filter(Leve i) { if (i?.Name == null || i.ItemName == null) { return(true); } if (Search == null) { return(validateToggle(i)); } return((FilterMatches(i.Name) || FilterMatches(i.ItemName)) && validateToggle(i)); }
/// <summary> /// checks a leave class against the toggles /// </summary> /// <param name="leve"></param> /// <returns></returns> private bool validateToggle(Leve leve) { if (!CRP && !BSM && !ARM && !GSM && !LTW && !WVR && !ALC && !CUL) { return(true); } if (CRP && leve.Classes.Contains("Carpenter")) { return(true); } if (BSM && leve.Classes.Contains("Blacksmith")) { return(true); } if (ARM && leve.Classes.Contains("Armorer")) { return(true); } if (GSM && leve.Classes.Contains("Goldsmith")) { return(true); } if (LTW && leve.Classes.Contains("Leatherworker")) { return(true); } if (WVR && leve.Classes.Contains("Weaver")) { return(true); } if (ALC && leve.Classes.Contains("Alchemist")) { return(true); } if (CUL && leve.Classes.Contains("Culinarian")) { return(true); } return(false); }