예제 #1
0
        public BusBuilder Configure(IAutoConfigurationModel autoConfigurationModel)
        {
            var autoConfigurator = new AutoConfigurator();

            autoConfigurator.Configure(_configurationContext.ConfigurationModel, autoConfigurationModel);
            return(this);
        }
예제 #2
0
 // 保存、読み込み
 public void Load()
 {
     // StringDictionaryからプロパティへもどす。
     _config = Setting.GetSettings(ConfigurationPath + @"\AppSettings.xml");
     AutoConfigurator.Configure(this,
                                new AutoConfigurator.ConfigurationHandler(LoadConfigHandler));
 }
예제 #3
0
        public void Save()
        {
            if (!System.IO.Directory.Exists(ConfigurationPath))
            {
                System.IO.Directory.CreateDirectory(ConfigurationPath);
            }

            // プロパティをStringDictionaryに格納。
            AutoConfigurator.GetConfiguration(this,
                                              new AutoConfigurator.GetConfigurationHandler(SaveConfigHandler));

            // XML に書き出す。
            Setting.SaveSettings(ConfigurationPath + @"\AppSettings.xml", _config);
        }
예제 #4
0
        public static async Task GenerateClientAsync(ConsoleOptions options)
        {
            var config = !options.ConfigCreate
                ? await Config.ReadFromAsync(options.Config)
                : await AutoConfigurator.CreateAndWriteConfig(options.Config);

            if (!config.Validate(out var configErrors))
            {
                var resultMessage = string.Join(
                    Environment.NewLine,
                    new[] { "wrong config file provided.", "Config file errors:" }.Concat(configErrors));
                throw new GeneratorInvalidOperationException(resultMessage);
            }

            var storage = new FromAssembliesGeneratorStore(new []
            {
                typeof(DotNetCoreGenerator).Assembly,
            });
            var schemaLoader = new FromUrlSchemaReader(config.SchemaUri, config.InnerLevelOfType);
            var writer       = CreateWriterFactory(config);

            var processor = new GenerationProcessor(storage, schemaLoader, writer);
            await processor.ProcessAsync(config.Generator, config.CreateGeneratorContext());
        }