コード例 #1
0
        public static ConfigurationBuilder <T> FromFile <T>(this ConfigurationBuilder <T> builder, string path, Action <FileReaderOptions> setupOptions = null)
        {
            var options = new FileReaderOptions();

            setupOptions?.Invoke(options);

            builder.Reader = new FileReader(path, options);
            return(builder);
        }
コード例 #2
0
        static async Task Main(string[] args)
        {
            var serviceCollection = new ServiceCollection();

            var fileReaderOptions = new FileReaderOptions
            {
                FilePath = Path.Combine(Directory.GetCurrentDirectory(), "sdp_input.txt")
            };

            serviceCollection.AddLogging();
            serviceCollection.AddFileReader(fileReaderOptions);
            serviceCollection.AddConsoleOutput(new ConsoleOutputOptions());
            serviceCollection.AddSdpProcessor();

            var serviceProvider = serviceCollection.BuildServiceProvider();

            var sdpProcessor = serviceProvider.GetRequiredService <ISdpProcessor>();

            await sdpProcessor.Start();
        }
コード例 #3
0
        public FileReader CreateFileReader(string fileName)
        {
            var options = new FileReaderOptions();

            return(new FileReader(fileName, options));
        }