コード例 #1
0
        static void Main(string[] args)
        {
            Parser.Default.ParseArguments <IndexerArguments>(args)
            .WithParsed(o =>
            {
                var config = new ComicViewerConfiguration()
                {
                    ComicRepositoryPath = o.IndexPath,
                    DatabasePath        = o.Database,
                    ThumbnailHeight     = new System.Collections.Generic.Dictionary <string, int>
                    {
                        { "small", 80 },
                        { "large", 300 }
                    }
                };
                var context      = new ComicBookContext(config, new Microsoft.EntityFrameworkCore.DbContextOptions <ComicBookContext>());
                var imgProcessor = new ImageSharpProcessor(config);
                var factory      = new ComicBookFactory(imgProcessor, new IComicInterigator[] {
                    new IdInterigator(),
                    new ImageInterigator(config, context, imgProcessor),
                    new VolumeInterigator(),
                    new IssueInterigator(),
                    new DateInterigator(),
                    new PublisherInterigator(),
                    new NameInterigator(),
                    new TitleInterigator()
                });
                var resolver = new StoreComicBookResolver(config, context);
                Console.WriteLine("Starting Index");
                var indexer = new StoreIndexer(config, factory, resolver).Run();
            })
            .WithNotParsed((errs) => { Console.WriteLine("Could not parse arguments"); });

#if DEBUG
            Console.WriteLine("Press any key to close.");
            Console.ReadKey();
#endif
        }
コード例 #2
0
ファイル: Model.cs プロジェクト: bartoszOsn/Kola
        public void Add(string path)
        {
            ComicBook book;

            try
            {
                book = ComicBookFactory.Create(path);
            }
            catch (FileFormatException e)
            {
                throw e;
            }
            catch (FileNotFoundException e)
            {
                MessageBox.Show(String.Format("There is no file {0}", e.FileName), "No file", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            Tabs.Add(book);
            if (Tabs.Count == 1)
            {
                SelectedTabIndex = 0;
            }
        }
コード例 #3
0
 public ComicBooksViewModel()
 {
     _comicBooks = new ObservableCollection <ComicBook> (ComicBookFactory.GetComicBooks());
 }