Exemplo n.º 1
0
 protected DocumentContext(Uri uri, string @namespace, GeneratorConfig generatorConfig, TypeRegistry typeRegistry,
                           ITypeMangler typeMangler)
 {
     Document         = IdlParser.BuildDocument(uri);
     Namespace        = @namespace;
     _uri             = uri;
     _generatorConfig = generatorConfig;
     TypeRegistry     = typeRegistry;
     TypeMangler      = typeMangler;
     TypeConverter    = new TypeConverter(typeRegistry, @namespace, CodeNamespace, TypeMangler);
 }
Exemplo n.º 2
0
        //config value change at runtime?
        protected Generator(GeneratorConfig generatorConfig, IDictionary <string, IList <string> > templates)
        {
            if (!templates.ContainsKey(generatorConfig.CodeFlavor))
            {
                throw new ArgumentException(string.Format("Templating type {0} is unknown!", generatorConfig.CodeFlavor));
            }
            _generatorConfig = generatorConfig;

            _outputFolder = generatorConfig.OutputFolder;
            if (_outputFolder != null && !_outputFolder.Exists)
            {
                _outputFolder.Create();
            }
            _templateLoader = new TemplateLoader(templates[generatorConfig.CodeFlavor]);
        }
Exemplo n.º 3
0
 public void UpdateConfig(GeneratorConfig config)
 {
     _generatorConfig = config;
     _outputFolder    = config.OutputFolder;
 }
Exemplo n.º 4
0
 protected abstract DocumentContext CreateDocumentContext(Uri uri, string idlNamespace, GeneratorConfig config,
                                                          TypeRegistry typeRegistry);