コード例 #1
0
        public async Task <byte[]> Export()
        {
            var categoryResponse = new List <CategoryResponseModel>();

            foreach (var item in await _repository.GetAllSupplier())
            {
                categoryResponse.Add(CreateResponse(item));
            }

            var categoriaExportada = new CategoryExport();
            var builder            = categoriaExportada.Export(categoryResponse);

            return(Encoding.Unicode.GetBytes(builder));
        }
コード例 #2
0
        private static void Main(string[] args)
        {
            // Configuration dirs
            string basePath;

            basePath  = Directory.GetCurrentDirectory() + "\\";
            wikiConf  = new WikiConf();
            wiki      = new WikiMedia(wikiConf.wikiURL, wikiConf.wikiDomain, wikiConf.wikiDefCategory);
            contatti  = new ContactsHelper(wiki);
            converter = new Model2PowerPoint(wiki, basePath, basePath + wikiConf.pptTemplate);
            string[] extNames = Directory.GetFiles(basePath + wikiConf.extractors);
            extractors = new SummaryBuilder[extNames.Length];
            for (int i = 0; i < extNames.Length; i++)
            {
                extractors[i] = new ExtractSummary(converter, extNames[i]);
            }
            string[] lines;
            if (File.Exists(wikiConf.loginConf) == true)
            {
                lines = File.ReadAllLines(wikiConf.loginConf, Encoding.UTF8);
            }
            else
            {
                lines = new string[2] {
                    null, null
                };
            }
            //GUI Init
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            wikiLoginForm  = new WikiLoginForm(wiki, lines[0], lines[1]);
            mainForm       = new MainForm(wiki, wikiConf);
            categoryExport = new CategoryExport(wiki, converter, extractors);
            categoryExport.SetCategories(wikiConf.categories);
            addressBookExport = new AddressBookExport(wiki, contatti);
            addressBookExport.SetCategories(wikiConf.categories);
            pageExport      = new PageExport(wiki, converter);
            replaceForm     = new ReplaceForm(wikiConf);
            createForm      = new CreateForm(wikiConf);
            pageProcessForm = new PageProcess(wikiConf, wiki);
            //GO
            Application.Run(mainForm);
        }