コード例 #1
0
        /// <summary>
        /// Example5s this instance.
        /// </summary>

        /** <example><para></para>
         * <code> var files = folderResources.findFiles("*.bib*", SearchOption.AllDirectories);
         * var targetFolder = folderResults.Add("WithoutTemplate", "Without template", "Exporting Excel files without column data annotation template");
         * BibTexTools.ExportToExcel(files, notation, log, null, targetFolder);
         * targetFolder = folderResults.Add("WithTemplate", "With template", "Exporting Excel files with column data annotation template");
         * // creating template from Type
         * propertyAnnotationPreset template = new propertyAnnotationPreset(typeof(BibTexEntryModel));
         * template.defaultItem.definitions.Add(templateFieldDataTable.columnWidth, 10);
         * template.defaultItem.definitions.Add(templateFieldDataTable.col_color, "#FF6600");
         * BibTexTools.ExportToExcel(files, notation, log, template, targetFolder); </code>
         * </example>
         */
        public void Example5_SpecifyFormattingManually()
        {
            var files = folderResources.findFiles("*.bib*", SearchOption.AllDirectories);

            var targetFolder = folderResults.Add("WithoutTemplate", "Without template", "Exporting Excel files without column data annotation template");

            BibTexTools.ExportToExcel(files, notation, log, null, targetFolder);

            targetFolder = folderResults.Add("WithTemplate", "With template", "Exporting Excel files with column data annotation template");

            // creating template from Type
            propertyAnnotationPreset template = new propertyAnnotationPreset(typeof(BibTexEntryModel));

            template.defaultItem.definitions.Add(templateFieldDataTable.columnWidth, 10);
            template.defaultItem.definitions.Add(templateFieldDataTable.col_color, "#FF6600");

            template.GetAnnotationPresetItem(nameof(BibTexEntryModel.journal)).definitions.Add(templateFieldDataTable.col_color, Color.Red);

            BibTexTools.ExportToExcel(files, notation, log, template, targetFolder);
        }
コード例 #2
0
        /// <summary>
        /// Short way for exporting BibTex files ...
        /// </summary>

        /** <example><para>Short way for exporting BibTex files ...</para>
         *  <code>
         *  // Example 3: Short way - using imbSCI find file
         *  String path = folderResources.findFile("S0306457309000259.bib", SearchOption.AllDirectories);
         *
         *  // High-level method, creates extended version of Excel file, with additional spreadsheet for Legend and other meta information
         *  var reportDataTable = BibTexTools.ExportToExcel(path, notation, log);
         *
         *  // Now, let's load all *.bib files
         *  System.Collections.Generic.List<string> paths = folderResources.findFiles("*.bib", SearchOption.AllDirectories);
         *
         *  // Exports all *.bib files
         *  System.Collections.Generic.List<DataTableForStatistics> exports = BibTexTools.ExportToExcel(paths, notation, log, null, folderResults);
         *
         *  // Printing filename and destination path, to a ILogBuilder log builder
         *  foreach (var export in exports)
         *  {
         *      log.log(export.TableName + " exported to: " + export.lastFilePath);
         *  }</code></example>
         */

        public void Example3_LoadAndExportToExcel_ShortWay()
        {
            // Example 3: Short way - using imbSCI find file
            String path = folderResources.findFile("S0306457309000259.bib", SearchOption.AllDirectories);

            // High-level method, creates extended version of Excel file, with additional spreadsheet for Legend and other meta information
            var reportDataTable = BibTexTools.ExportToExcel(path, notation, log);

            // Now, let's load all *.bib files
            System.Collections.Generic.List <string> paths = folderResources.findFiles("*.bib", SearchOption.AllDirectories);

            // Exports all *.bib files
            System.Collections.Generic.List <DataTableForStatistics> exports = BibTexTools.ExportToExcel(paths, notation, log, null, folderResults);

            // Printing filename and destination path, to a ILogBuilder log builder
            foreach (var export in exports)
            {
                log.log(export.TableName + " exported to: " + export.lastFilePath);
            }
        }