public CountyList getCountyList() { if (countyList == null) { buildCountyList(); } CountyList result = markWorkedCounties(); return(result); }
private CountyList markWorkedCounties() { CountyList result = new CountyList(); string[] workedCounties = getWorkedCountiesArray(); foreach (County county in countyList) { county.Worked = workedCounties.Contains(county.Abbr); result.Add(county); } return(result); }
protected void buildCountyList() { countyList = new CountyList(); countyAbbreviations = countyAbbreviations.OrderBy(x => x).ToArray(); foreach (string abbr in countyAbbreviations) { County county = new County() { Abbr = abbr, Worked = false, State = stateAbbr, Name = getCountyFromAbbr(abbr) }; countyList.Add(county); } }