Ejemplo n.º 1
0
        public static EDaysOfWeek ConvertFrom(EDaysOfWeekExt dayOfWeek)
        {
            if (DaysOfWeekExt.IsDayGroupClassifier(dayOfWeek))
            {
                throw new ArgumentException($"Day Group Classifiers of the type {typeof(EDaysOfWeekExt)} cannnot be converted to the type {typeof(EDaysOfWeek)}.");
            }

            if (Enum.IsDefined(typeof(EDaysOfWeekExt), dayOfWeek))
            {
                return((EDaysOfWeek)Enum.Parse(typeof(EDaysOfWeek), Enum.GetName(typeof(EDaysOfWeekExt), dayOfWeek)));
            }
            else
            {
                throw new ArgumentException($"Undefined {typeof(EDaysOfWeekExt)} value ({(int) dayOfWeek}).");
            }
        }
Ejemplo n.º 2
0
 public static DateTime GetDate(int year, int month, EWeeksInMonth weekInMonth, EDaysOfWeek dayOfWeek)
 {
     return(GetDate(year, Month.GetMonth(month), weekInMonth, DaysOfWeekExt.ConvertFrom(dayOfWeek)));
 }