public void Configure(string json) { /// Factory Principal, que va a crear la lista de analysis set IAnalysisSetFactory analysisSetFactory = this.container.Resolve <IAnalysisSetFactory>(); /// Factory de resultados de analisis de cantidad IQuantityAnalysisResultFactory quantityAnalysisResultFactory = this.container.Resolve <IQuantityAnalysisResultFactory>(); IQuantityAnalysisFactory quantityAnalysisFactory = this.container.Resolve <IQuantityAnalysisFactory>(); quantityAnalysisFactory.QuantityAnalysisResultFactory = quantityAnalysisResultFactory; /// Lista de busquedas por cantidad disponibles Dictionary <string, IQuantitySearchJSONFactory> availableSearchFactories = new Dictionary <string, IQuantitySearchJSONFactory>(); /// Busqueda por todas las direcciones IQuantitySearchFactory allDirectionsSequenceQuantitySearchFactory = this.container.Resolve <IQuantitySearchFactory>("AllDirectionsSequenceQuantitySearchFactory"); IQuantitySearchJSONFactory allDirectionsQuantityJSONFactory = this.container.Resolve <IQuantitySearchJSONFactory>(new ParameterOverride("quantitySearchFactory", allDirectionsSequenceQuantitySearchFactory), new ParameterOverride("type", "alldirectionssequencequantity")); availableSearchFactories.Add(allDirectionsQuantityJSONFactory.Type, allDirectionsQuantityJSONFactory); /// Factory de busquedas por cantidad, con las busquedas por cantidad disponibles IQuantitySearchTypesFactory quantitySearchTypesFactory = this.container.Resolve <IQuantitySearchTypesFactory>(new ParameterOverride("availableQuantityFactories", availableSearchFactories)); IAnalysisJSONFactory quantityAnalysisJSONFactory = this.container.Resolve <IAnalysisJSONFactory>( "QuantityAnalysisJSONFactory", new ParameterOverride("quantityAnalysisFactory", quantityAnalysisFactory), new ParameterOverride("quantitySearchTypesFactory", quantitySearchTypesFactory)); Dictionary <string, IAnalysisJSONFactory> availableAnalysisFactories = new Dictionary <string, IAnalysisJSONFactory>(); availableAnalysisFactories.Add(quantityAnalysisJSONFactory.Type, quantityAnalysisJSONFactory); IAnalysisTypesFactory analysisTypesFactory = this.container.Resolve <IAnalysisTypesFactory>(new ParameterOverride("availableAnalysisFactories", availableAnalysisFactories)); IAnalysisSetJSONFactory factory = this.container.Resolve <IAnalysisSetJSONFactory>(new ParameterOverride("analysisSetFactory", analysisSetFactory), new ParameterOverride("analysisTypesFactory", analysisTypesFactory)); this.analysisSets = factory.CreateInstance(json); }
public QuantitySearchJSONFactory(IQuantitySearchFactory quantitySearchFactory, string type) { this.QuantitySearchFactory = quantitySearchFactory; this.Type = type; }