src/Azos/Conf/FactoryUtils.cs
/// <summary>
/// Creates and configures an instance of appropriate configurable object as specified in supplied config node.
/// Applies configured behaviours
/// </summary>
Creates and configures an instance of appropriate configurable object as specified in supplied config node.
Applies configured behaviours
Creates and configures an instance of appropriate configurable object as specified in supplied config node . Applies configured behaviours
public static T MakeAndConfigure<T>(IConfigSectionNode node, Type defaultType = null, object[] args = null)
            where T : IConfigurable
        {
            var result = Make<T>(node, defaultType, args);
            var etp = result.GetType();
            var macroAttr = etp.GetCustomAttributes(typeof(ConfigMacroContextAttribute), true).FirstOrDefault() as ConfigMacroContextAttribute;
            if (macroAttr!=null)
                 node.Configuration.MacroRunnerContext = result;
            result.Configure(node);
            Behavior.ApplyConfiguredBehaviors(result, node);
            return result;
        }
public static T MakeAndConfigure < T > ( IConfigSectionNode node , Type defaultType = null , object [ ] args = null ) where T : IConfigurable { var result = Make < T > ( node , defaultType , args ) ; var etp = result . GetType ( ) ; var macroAttr = etp . GetCustomAttributes ( typeof ( ConfigMacroContextAttribute ) , true ) . FirstOrDefault ( ) as ConfigMacroContextAttribute ; if ( macroAttr != null ) node . Configuration . MacroRunnerContext = result ; result . Configure ( node ) ; Behavior . ApplyConfiguredBehaviors ( result , node ) ; return result ; }
Creates and configures an instance of appropriate configurable object as specified in supplied config node.
Creates and configures an instance of appropriate configurable object as specified in supplied config node .
//20130708 DKh - support for [ConfigMacroContext] injection //---
node
IConfigSectionNode
defaultType
Type
args
object[]