Ejemplo n.º 1
0
        public Generator(GeneratorParameters parameters, ITemplateInputProvider templateProvider, ITemplateSignatureProvider templateSignatureProvider, IFieldMappingProvider fieldMappingProvider, ISynthesisIndexFieldNameTranslator indexFieldNameTranslator)
        {
            parameters.Validate();
            Parameters = parameters;

            _templateInputProvider = templateProvider;
            _templateSignatureProvider = templateSignatureProvider;
            _fieldMappingProvider = fieldMappingProvider;
            _indexFieldNameTranslator = indexFieldNameTranslator;

            // load the templates we'll be generating into a state storage collection
            var templates = templateProvider.CreateTemplateList();
            Templates = new TemplateGenerationInfoCollection(parameters.UseTemplatePathForNamespace, parameters.TemplatePathRoot);
            foreach (var template in templates) Templates.Add(template);
        }
Ejemplo n.º 2
0
        public Generator(GeneratorParameters parameters, ITemplateInputProvider templateProvider, ITemplateSignatureProvider templateSignatureProvider, IFieldMappingProvider fieldMappingProvider, ISynthesisIndexFieldNameTranslator indexFieldNameTranslator)
        {
            parameters.Validate();
            Parameters = parameters;

            _templateInputProvider     = templateProvider;
            _templateSignatureProvider = templateSignatureProvider;
            _fieldMappingProvider      = fieldMappingProvider;
            _indexFieldNameTranslator  = indexFieldNameTranslator;

            // load the templates we'll be generating into a state storage collection
            var templates = templateProvider.CreateTemplateList();

            Templates = new TemplateGenerationInfoCollection(parameters.UseTemplatePathForNamespace, parameters.TemplatePathRoot);
            foreach (var template in templates)
            {
                Templates.Add(template);
            }
        }
Ejemplo n.º 3
0
        private TemplateGenerationMetadata CreateTemplateData()
        {
            var templates = _templateInputProvider.CreateTemplateList();

            var templateData = new TemplateGenerationMetadata(_parameters.UseTemplatePathForNamespace, _parameters.TemplatePathRoot, _parameters);

            foreach (var friendMetadata in _parameters.GetFriendMetadata())
            {
                foreach (var iface in friendMetadata.Interfaces)
                {
                    templateData.AddFriendInterface(iface);
                }
            }

            foreach (var template in templates)
            {
                templateData.AddConcrete(template);
            }
            return(templateData);
        }