コード例 #1
0
        private static void InsertWithOrder(
            ConfigurationData configurationItem,
            ISimpleDictionary <Type, int> configurationIndexesByType,
            IDictionary <Type, ConfigurationData> configurationDataByType,
            ICollection <Type> checkedTypes)
        {
            ThrowIfCircularDependencyDetected(configurationItem, checkedTypes);

            var typeIndex = -1;

            foreach (var configurationType in configurationItem.DependedOnConfigurationTypes)
            {
                var index = GetIndexOf(
                    configurationType,
                    configurationIndexesByType,
                    configurationDataByType,
                    checkedTypes);

                if (index > typeIndex)
                {
                    typeIndex = index + 1;
                }
            }

            while (configurationIndexesByType.Values.Contains(typeIndex))
            {
                ++typeIndex;
            }

            configurationIndexesByType.Add(configurationItem.ConfigurationType, typeIndex);
        }
コード例 #2
0
        public void RegisterCreationCallback(MapperCreationCallbackKey creationCallbackKey, Action <IObjectMapper> callback)
        {
            _creationCallbacksByKey ??=
            new ExpandableSimpleDictionary <MapperCreationCallbackKey, Action <IObjectMapper> >(
                3,
                default(MapperCreationCallbackKey.Comparer));

            _creationCallbacksByKey.Add(creationCallbackKey, callback);
        }