Beispiel #1
0
        protected virtual void ConfigureBootstrapper(GeneratorBootstrapper bootstrapper, GeneratorContext generatorContext)
        {
            if (bootstrapper == null)
            {
                throw new ArgumentNullException(nameof(bootstrapper));
            }
            if (generatorContext == null)
            {
                throw new ArgumentNullException(nameof(generatorContext));
            }
            var configuration = CreateConfiguration();

            // This is kept separate from Bootstrapper because you might want to use your own assemblies.
            // You might also want to pass in your own version of generator context
            bootstrapper.RegisterConvention(
                new MultiAssemblyImplementationRegistrationConvention(
                    generatorContext.GeneratorType.GetAssembly()));
            bootstrapper.RegisterConvention(new GeneratorRegistrationConvention(configuration, generatorContext));
        }
Beispiel #2
0
 protected override void ConfigureBootstrapper(GeneratorBootstrapper bootstrapper,
                                               GeneratorContext generatorContext)
 {
     base.ConfigureBootstrapper(bootstrapper, generatorContext);
     _configurationAction(bootstrapper);
 }