/// <summary>
        /// Gets the recurrence from string.
        /// </summary>
        /// <param name="recurranceString">The recurrance string.</param>
        /// <returns></returns>
        private static Recurrence GetRecurrenceFromString(string recurranceString)
        {
            Recurrence recurrence = null;

            switch (recurranceString)
            {
            case XmlElementNames.RelativeYearlyRecurrence:
                recurrence = new Recurrence.RelativeYearlyPattern();
                break;

            case XmlElementNames.AbsoluteYearlyRecurrence:
                recurrence = new Recurrence.YearlyPattern();
                break;

            case XmlElementNames.RelativeMonthlyRecurrence:
                recurrence = new Recurrence.RelativeMonthlyPattern();
                break;

            case XmlElementNames.AbsoluteMonthlyRecurrence:
                recurrence = new Recurrence.MonthlyPattern();
                break;

            case XmlElementNames.DailyRecurrence:
                recurrence = new Recurrence.DailyPattern();
                break;

            case XmlElementNames.DailyRegeneration:
                recurrence = new Recurrence.DailyRegenerationPattern();
                break;

            case XmlElementNames.WeeklyRecurrence:
                recurrence = new Recurrence.WeeklyPattern();
                break;

            case XmlElementNames.WeeklyRegeneration:
                recurrence = new Recurrence.WeeklyRegenerationPattern();
                break;

            case XmlElementNames.MonthlyRegeneration:
                recurrence = new Recurrence.MonthlyRegenerationPattern();
                break;

            case XmlElementNames.YearlyRegeneration:
                recurrence = new Recurrence.YearlyRegenerationPattern();
                break;

            default:
                throw new ServiceXmlDeserializationException(string.Format(Strings.InvalidRecurrencePattern, recurranceString));
            }
            return(recurrence);
        }
        /// <summary>
        /// Gets the recurrence from string.
        /// </summary>
        /// <param name="recurranceString">The recurrance string.</param>
        /// <returns></returns>
        private static Recurrence GetRecurrenceFromString(string recurranceString)
        {
            Recurrence recurrence = null;

            switch (recurranceString)
            {
                case XmlElementNames.RelativeYearlyRecurrence:
                    recurrence = new Recurrence.RelativeYearlyPattern();
                    break;
                case XmlElementNames.AbsoluteYearlyRecurrence:
                    recurrence = new Recurrence.YearlyPattern();
                    break;
                case XmlElementNames.RelativeMonthlyRecurrence:
                    recurrence = new Recurrence.RelativeMonthlyPattern();
                    break;
                case XmlElementNames.AbsoluteMonthlyRecurrence:
                    recurrence = new Recurrence.MonthlyPattern();
                    break;
                case XmlElementNames.DailyRecurrence:
                    recurrence = new Recurrence.DailyPattern();
                    break;
                case XmlElementNames.DailyRegeneration:
                    recurrence = new Recurrence.DailyRegenerationPattern();
                    break;
                case XmlElementNames.WeeklyRecurrence:
                    recurrence = new Recurrence.WeeklyPattern();
                    break;
                case XmlElementNames.WeeklyRegeneration:
                    recurrence = new Recurrence.WeeklyRegenerationPattern();
                    break;
                case XmlElementNames.MonthlyRegeneration:
                    recurrence = new Recurrence.MonthlyRegenerationPattern();
                    break;
                case XmlElementNames.YearlyRegeneration:
                    recurrence = new Recurrence.YearlyRegenerationPattern();
                    break;
                default:
                    throw new ServiceXmlDeserializationException(string.Format(Strings.InvalidRecurrencePattern, recurranceString));
            }
            return recurrence;
        }