Create static method

TimeZoneTransition Create(
  1. TimeZoneDefinition? timeZoneDefinition,
  2. String xmlElementName
)
Creates a time zone period transition of the appropriate type given an XML element name. The time zone definition to which the transition will belong. The XML element name.

Implementation

static TimeZoneTransition Create(
    TimeZoneDefinition? timeZoneDefinition, String xmlElementName) {
  switch (xmlElementName) {
    case XmlElementNames.AbsoluteDateTransition:
      return new AbsoluteDateTransition(timeZoneDefinition);
    case XmlElementNames.RecurringDayTransition:
      return new RelativeDayOfMonthTransition(timeZoneDefinition);
    case XmlElementNames.RecurringDateTransition:
      return new AbsoluteDayOfMonthTransition(timeZoneDefinition);
    case XmlElementNames.Transition:
      return new TimeZoneTransition(timeZoneDefinition);
    default:
      throw new ServiceLocalException("""string.Format(
                          Strings.UnknownTimeZonePeriodTransitionType,
                          xmlElementName)""");
  }
}