/// <summary>
        /// Processes a parameter map element.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="configurationStore">The configuration store.</param>
        private void ProcessParameterMapElement(Tag element, IConfigurationStore configurationStore)
        {
            MutableConfiguration config = null;

            if (element.Attributes.ContainsKey(ConfigConstants.ATTRIBUTE_CLASS))
            {
                config = new MutableConfiguration(
                        element.Name,
                        ApplyNamespace(element.Attributes[ConfigConstants.ATTRIBUTE_ID]),
                        element.Attributes[ConfigConstants.ATTRIBUTE_CLASS]);
            }
            else
            {
                config = new MutableConfiguration(
                        element.Name,
                        ApplyNamespace(element.Attributes[ConfigConstants.ATTRIBUTE_ID]));
            }
            config.CreateAttributes(element.Attributes);
            config.CreateAttribute(ConfigConstants.ATTRIBUTE_NAMESPACE, nameSpace);

            AddAttribute(config, ConfigConstants.ATTRIBUTE_EXTENDS, true);

            configurationStore.AddParameterMapConfiguration(config);
            element.Configuration = config;
        }
예제 #2
0
 private void BuildParameterMap(IConfigurationStore configurationStore)
 {
     for (int i = 0; i < store.ParameterMaps.Length; i++)
     {
         configurationStore.AddParameterMapConfiguration(store.ParameterMaps[i]);
     }
 }
예제 #3
0
        /// <summary>
        /// Processes a parameter map element.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <param name="configurationStore">The configuration store.</param>
        private void ProcessParameterMapElement(Tag element, IConfigurationStore configurationStore)
        {
            MutableConfiguration config = null;

            if (element.Attributes.ContainsKey(ConfigConstants.ATTRIBUTE_CLASS))
            {
                config = new MutableConfiguration(
                    element.Name,
                    ApplyNamespace(element.Attributes[ConfigConstants.ATTRIBUTE_ID]),
                    element.Attributes[ConfigConstants.ATTRIBUTE_CLASS]);
            }
            else
            {
                config = new MutableConfiguration(
                    element.Name,
                    ApplyNamespace(element.Attributes[ConfigConstants.ATTRIBUTE_ID]));
            }
            config.CreateAttributes(element.Attributes);
            config.CreateAttribute(ConfigConstants.ATTRIBUTE_NAMESPACE, nameSpace);

            AddAttribute(config, ConfigConstants.ATTRIBUTE_EXTENDS, true);

            configurationStore.AddParameterMapConfiguration(config);
            element.Configuration = config;
        }
예제 #4
0
        /// <summary>
        /// Registers the current configuration.
        /// </summary>
        /// <returns></returns>
        public MutableConfiguration RegisterConfiguration()
        {
            MutableConfiguration configuration = currentConfiguration;

            if (currentConfiguration != null)
            {
                switch (currentConfiguration.Type)
                {
                case ConfigConstants.ELEMENT_TYPEALIAS:
                    store.AddAliasConfiguration(currentConfiguration);
                    break;

                case ConfigConstants.ELEMENT_TYPEHANDLER:
                    store.AddTypeHandlerConfiguration(currentConfiguration);
                    break;

                case ConfigConstants.ELEMENT_RESULTMAP:
                    store.AddResultMapConfiguration(currentConfiguration);
                    break;

                case ConfigConstants.ELEMENT_PARAMETERMAP:
                    store.AddParameterMapConfiguration(currentConfiguration);
                    break;

                case ConfigConstants.ELEMENT_RESULT:
                case ConfigConstants.ELEMENT_DISCRIMINATOR:
                case ConfigConstants.ELEMENT_CONSTRUCTOR:
                case ConfigConstants.ELEMENT_PARAMETER:
                    break;

                default:
                    throw new DataMapperException("Invalid configuration registration for configuration type:" + currentConfiguration.Type);
                }
                currentConfiguration = null;
            }

            return(configuration);
        }