Пример #1
0
        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);
        }
Пример #2
0
        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);
        }