Пример #1
0
        private static void HandlePlugInMultiFunctionAggregation(
            ConfigurationCompiler configuration,
            XmlElement element)
        {
            var functionNames = DOMExtensions.GetRequiredAttribute(element, "function-names");
            var forgeClassName = DOMExtensions.GetOptionalAttribute(element, "forge-class");

            var nodeEnumerator = DOMElementEnumerator.Create(element.ChildNodes);
            IDictionary<string, object> additionalProps = null;
            while (nodeEnumerator.MoveNext()) {
                XmlElement subElement = nodeEnumerator.Current;
                if (subElement.Name == "init-arg") {
                    var name = DOMExtensions.GetRequiredAttribute(subElement, "name");
                    var value = DOMExtensions.GetRequiredAttribute(subElement, "value");
                    if (additionalProps == null) {
                        additionalProps = new Dictionary<string, object>();
                    }

                    additionalProps.Put(name, value);
                }
            }

            var config = new ConfigurationCompilerPlugInAggregationMultiFunction(
                functionNames.SplitCsv(),
                forgeClassName);
            config.AdditionalConfiguredProperties = additionalProps;
            configuration.AddPlugInAggregationMultiFunction(config);
        }
Пример #2
0
 /// <summary>
 ///     Adds a plug-in aggregation multi-function.
 /// </summary>
 /// <param name="config">the configuration</param>
 public void AddPlugInAggregationMultiFunction(ConfigurationCompilerPlugInAggregationMultiFunction config)
 {
     PlugInAggregationMultiFunctions.Add(config);
 }