public ISet <DayOfWeek> Convert(DaysOfWeek value) { HashSet <DayOfWeek> result = new HashSet <DayOfWeek>(); foreach (Tuple <DaysOfWeek, DayOfWeek> tuple in DayOfWeekConverter.MappingTuples) { DayOfWeekConverter.AddDayToSetIfPresent(value, tuple.Item1, tuple.Item2, result); } return(result); }
public DaysOfWeek Convert(ISet <DayOfWeek> value) { if (value == null) { throw new ExArgumentNullException("value"); } DaysOfWeek result = DaysOfWeek.None; foreach (Tuple <DaysOfWeek, DayOfWeek> tuple in DayOfWeekConverter.MappingTuples) { DayOfWeekConverter.AddDayToSetIfPresent(value, tuple.Item2, tuple.Item1, ref result); } return(result); }