Ejemplo n.º 1
0
        /// <summary>
        /// Converts LocationsDefaults to LocationsDefaultsConfig.
        /// </summary>
        /// <param name="locationDefaults">LocationsDefaults object.</param>
        /// <returns>Converted object.</returns>
        private LocationsDefaultsConfig _ConvertLocationsDefaultsToConfig(LocationsDefaults locationDefaults)
        {
            Debug.Assert(locationDefaults != null);

            LocationsDefaultsConfig locationsDefaultsConfig = new LocationsDefaultsConfig();

            locationsDefaultsConfig.CurbApproach = locationDefaults.CurbApproach;
            locationsDefaultsConfig.TimeWindow   = locationDefaults.TimeWindow;

            return(locationsDefaultsConfig);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Merges specified user and default configurations.
        /// </summary>
        /// <param name="userConfig">The user configuration.</param>
        /// <param name="defaultConfig">The default configuration.</param>
        /// <returns>A new configuration object with values stored in the user configuration
        /// if there are any or values stored in the default configuration otherwise.</returns>
        private static LocationsDefaults _Merge(
            LocationsDefaultsConfig userConfig,
            LocationsDefaultsConfig defaultConfig)
        {
            if (userConfig == null)
            {
                userConfig = new LocationsDefaultsConfig();
            }

            return(new LocationsDefaults
            {
                CurbApproach = _Merge(userConfig.CurbApproach, defaultConfig.CurbApproach),
                TimeWindow = _Merge(userConfig.TimeWindow, defaultConfig.TimeWindow),
            });
        }