Пример #1
0
 public MySwordCommentariesSaver(
     ILogger <MySwordCommentariesSaver> logger,
     ICommentaryFormater <MySwordReferenceConverter> commentaryFormater)
 {
     _logger             = logger;
     _commentaryFormater = commentaryFormater;
     _referenceConverter = new MySwordReferenceConverter();
 }
Пример #2
0
        private static void Main(string[] args)
        {
            Console.WriteLine(FiggleFonts.Standard.Render("PaS to MySword & MyBible"), Color.Red);

            using var serviceProvider = new ServiceCollection()
                                        .AddSingleton <MySwordCommentariesSaver>()
                                        .AddSingleton <MyBibleCommentariesSaver>()
                                        .AddSingleton <OSISCommentariesSaver>()

                                        .AddSingleton <BibleOnlineImporter>()

                                        .AddSingleton <MyBibleReferenceConverter>()
                                        .AddSingleton <MySwordReferenceConverter>()
                                        .AddSingleton <OSISReferenceConverter>()

                                        .AddSingleton <ICommentaryFormater <MyBibleReferenceConverter>, CommentaireHtmlFormater <MyBibleReferenceConverter> >()
                                        .AddSingleton <ICommentaryFormater <MySwordReferenceConverter>, CommentaireHtmlFormater <MySwordReferenceConverter> >()
                                        .AddSingleton <OSISFormater>()

                                        .AddLogging(config =>
            {
                config.ClearProviders().SetMinimumLevel(LogLevel.Trace);
                config.AddNLog();
            }
                                                    )
                                        .BuildServiceProvider();

            _mySwordCommentariesExport = serviceProvider.GetService <MySwordCommentariesSaver>();
            _myBibleCommentariesExport = serviceProvider.GetService <MyBibleCommentariesSaver>();
            _osisCommentariesExport    = serviceProvider.GetService <OSISCommentariesSaver>();

            _commentaireHtmlFormater = serviceProvider.GetService <ICommentaryFormater <MySwordReferenceConverter> >();

            _bibleOnlineImporter = serviceProvider.GetService <BibleOnlineImporter>();

            Parser.Default.ParseArguments <CommandLineOptions>(args)
            .WithParsed(RunOptions);
        }