public ConfigurationBuilder(DynamicConfiguration built, IEnumerable<IMethodStrategy> strategies)
        {
            if(built == null)
                throw new ArgumentException("You must specify a DynamicConfiguration object to be built.");

            if(strategies == null)
                throw new ArgumentException("You Must specify collection of IMethodStrategy to deal with dynamic method invocation.");

            _built = built;

            _strategies = new List<IMethodStrategy>(strategies);
        }
Beispiel #2
0
        protected Gadget(Action<ConfigurationBuilder> configurationAction, IEnumerable<IMethodStrategy> additionalethodStrategies  = null)
        {
            Configuration = new DynamicConfiguration();

            var methodStrategies = new List<IMethodStrategy>()
                                                {
                                                    new PropertySetter(),
                                                    new ListItemSetter()
                                                };

            if (additionalethodStrategies != null)
                methodStrategies.AddRange(additionalethodStrategies);

            configurationAction(new ConfigurationBuilder(Configuration, methodStrategies));
        }