コード例 #1
0
        /// <summary>
        /// Adds the PlantUML target renderer to a service collection.
        /// </summary>
        /// <param name="services">The instance of the service collection.</param>
        /// <param name="config">The builder of the PlantUML target renderer.</param>
        /// <returns>The service collection.</returns>
        public static IServiceCollection AddPlantUmlTarget(this IServiceCollection services, Action <ITargetBuilder> config)
        {
            services.AddPlantUmlTarget();

            TargetBuilder configuration = new TargetBuilder();

            config(configuration);

            configuration.UpdateServices(services);
            return(services);
        }
コード例 #2
0
        /// <summary>
        /// Adds the PlantUML target renderer to a translator configuration.
        /// </summary>
        /// <param name="config">The instance of the translator configuration.</param>
        /// <param name="configure">The builder of the PlantUML target renderer.</param>
        /// <returns>The service collection.</returns>
        public static void AddPlantUmlTarget(this ITranslatorConfig config, Action <ITargetBuilder> configure = null)
        {
            IServiceCollection services = new ServiceCollection();

            services.AddPlantUmlTarget();

            TargetBuilder configuration = new TargetBuilder();

            if (configure != null)
            {
                configure(configuration);
            }

            configuration.UpdateServices(services);
            config.AddTarget(typeof(PlantUmlTargetRenderer), services);
        }