InitializeTransitions method

void InitializeTransitions()
Initializes the /* private */ members holding references to the transitions to the Daylight and Standard periods.

Implementation

/* private */
void InitializeTransitions() {
  if (this.transitionToStandard == null) {
    for (TimeZoneTransition transition in this.transitions) {
      if (transition.TargetPeriod!.IsStandardPeriod ||
          (this.transitions.length == 1)) {
        this.transitionToStandard = transition;
      } else {
        this.transitionToDaylight = transition;
      }
    }
  }

  // If we didn't find a Standard period, this is an invalid time zone group.
  if (this.transitionToStandard == null) {
    throw new ServiceLocalException(
        "Strings.InvalidOrUnsupportedTimeZoneDefinition");
  }
}