コード例 #1
0
        private ObjectConfigurationInfo CreateObjectConfiguration(ConfigureDelegate configMethod)
        {
            ObjectConfigurationInfo config = new ObjectConfigurationInfo();

            config.ConfigureDelegate = configMethod;
            return(config);
        }
コード例 #2
0
        public void ConfigureObject <T>(object item)
        {
            if (state.TypedObjectConfigurations.ContainsKey(typeof(T)))
            {
                ObjectConfigurationInfo config = state.TypedObjectConfigurations[typeof(T)];
                config.ConfigureDelegate(item);
                ConfigureObjectWithTemplates(item);
                return;
            }

            throw ExceptionHelper.TypedConfigurationNotFoundException(typeof(T));
        }
コード例 #3
0
        public void ConfigureObject <T>(string configId, T item)
        {
            if (state.NamedObjectConfigurations.ContainsKey(configId))
            {
                ObjectConfigurationInfo config = state.NamedObjectConfigurations[configId];
                config.ConfigureDelegate(item);
                ConfigureObjectWithTemplates(item);
                return;
            }

            throw ExceptionHelper.NamedConfigurationNotFoundException(configId);
        }
コード例 #4
0
        private void RegisterObjectTemplateConfigurationMethod(Type configType, ConfigureDelegate configMethod)
        {
            ObjectConfigurationInfo config = CreateObjectConfiguration(configMethod);

            state.ApplyToAllObjectConfigurations.Add(configType, config);
        }
コード例 #5
0
        public void RegisterObjectConfigurationMethod(string configId, ConfigureDelegate configMethod)
        {
            ObjectConfigurationInfo config = CreateObjectConfiguration(configMethod);

            state.NamedObjectConfigurations.Add(configId, config);
        }