Esempio n. 1
0
        private void ConvertMonthlyOccurrenceToSelectedIndex(object input, out int output)
        {
            Models.MonthlyOccurrenceTypeEnum value = (Models.MonthlyOccurrenceTypeEnum)input;
            switch (value)
            {
            default: throw new ArgumentException(string.Format("Invalid {0} value for SelectedIndex: {1}",
                                                               typeof(Models.MonthlyOccurrenceTypeEnum).FullName, value));

            case Models.MonthlyOccurrenceTypeEnum.FIRST: output = 0; break;

            case Models.MonthlyOccurrenceTypeEnum.SECOND: output = 1; break;

            case Models.MonthlyOccurrenceTypeEnum.THIRD: output = 2; break;

            case Models.MonthlyOccurrenceTypeEnum.FOURTH: output = 3; break;

            case Models.MonthlyOccurrenceTypeEnum.PENULTIMATE: output = 4; break;

            case Models.MonthlyOccurrenceTypeEnum.LAST: output = 5; break;
            }
        }
Esempio n. 2
0
        private void ConvertSelectedIndexToMonthlyOccurrence(object input, out Models.MonthlyOccurrenceTypeEnum output)
        {
            int value = (int)input;

            switch (value)
            {
            default: throw new ArgumentException(string.Format("Invalid {0} value: {1}",
                                                               typeof(Models.MonthlyOccurrenceTypeEnum).FullName, value));

            case 0: output = Models.MonthlyOccurrenceTypeEnum.FIRST; break;

            case 1: output = Models.MonthlyOccurrenceTypeEnum.SECOND; break;

            case 2: output = Models.MonthlyOccurrenceTypeEnum.THIRD; break;

            case 3: output = Models.MonthlyOccurrenceTypeEnum.FOURTH; break;

            case 4: output = Models.MonthlyOccurrenceTypeEnum.PENULTIMATE; break;

            case 5: output = Models.MonthlyOccurrenceTypeEnum.LAST; break;
            }
        }