public void Initialize() { _documentTypeRepositoryMock = DocumentTypeRepositoryMock.GetDocumentTypeRepositoryMock(); _generatedDocumentRepositoryMock = GeneratedDocumentRepositoryMock.GetGeneratedDocumentRepositoryMock(); jsonContent = new GenerateDocumentRequest(); htmlContent = new GenerateDocumentRequest(); nsiContext = new NsiContext(); htmlGenerator = new NSI.DocumentGenerator.Implementations.HtmlGenerator(new NSI.DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper()); pdfGenerator = new NSI.DocumentGenerator.Implementations.PdfGenerator(); _docxGeneratorMock = DocxGeneratorMock.GetDocxGeneratorMock(); _odtGeneratorMock = OdtGeneratorMock.GetOdtGeneratorMock(); generatedDocumentLogger = new NSI.DocumentGenerator.Implementations.Helpers.GeneratedDocumentLogger(_generatedDocumentRepositoryMock.Object); templateGenerator = new TemplateGenerator(new NSI.DocumentGenerator.Implementations.PdfGenerator(), new NSI.DocumentGenerator.Implementations.HtmlGenerator(new NSI.DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper())); documentGenerator = new NSI.DocumentGenerator.Implementations.Generators.DocumentGenerator(_documentTypeRepositoryMock.Object, generatedDocumentLogger, htmlGenerator, pdfGenerator, _odtGeneratorMock.Object, _docxGeneratorMock.Object, templateGenerator); jsonDocumentTypeDomain = new DocumentTypeDomain() { Name = "json", Code = "json", Version = "1.0", Encoding = "utf-8" }; htmlDocumentTypeDomain = new DocumentTypeDomain() { Name = "html", Code = "html", Version = "1.0", Encoding = "utf-8" }; }
public ResourcesControl(IResourceMerge resourceMerge, Solution dte, ILogger outputWindowLogger, Action <string, string, DialogIcon> showDialogAction) { InitializeComponent(); _excelGenerator = new ExcelGenerator(); _resourceMerge = resourceMerge; _showDialogAction = showDialogAction; _logMessages = new List <string>(); ILogger combinedLogger = new CombinedLogger(outputWindowLogger, new DialogLogger(_logMessages)); resourceMerge.SetLogger(combinedLogger); _statusProgress = new StatusProgress( p => { Dispatcher.Invoke(() => { StatusProgress.Value = p; StatusProgressText.Text = (int)Math.Round(p) + "%"; }); }, (s, p) => { Dispatcher.Invoke(() => { StatusProgress.Value = p; StatusProgressText.Text = (int)Math.Round(p) + "%"; StatusText.Text = s; }); } ); _cancellationTokenSource = new CancellationTokenSource(); InitializeData(dte); }
private async Task ImportFromDocument(IDocumentGenerator documentGenerator, string path, IReadOnlyCollection <string> selectedCultures, IReadOnlyCollection <Project> selectedProjects, IStatusProgress progress, CancellationToken cancellationToken) { IReadOnlyList <ResGroupModel <ResExcelModel> > data = await documentGenerator.ImportFromDocumentAsync <ResExcelModel>(path, progress, cancellationToken); progress.Report(StatusRes.GettingProjectsResources); SolutionResources resources = await GetSolutionResourcesAsync(selectedCultures, selectedProjects, progress, cancellationToken); progress.Report(StatusRes.MergingResources); var projectsJoin = resources.ProjectResources .Join(data, projRes => projRes.ProjectName, excelProjRes => excelProjRes.GroupTitle, (projRes, excelProjRes) => new { ProjRes = projRes, ExcelProjRes = excelProjRes }); foreach (var project in projectsJoin) { var resourceTablesJoin = project.ProjRes.Resources .Join(project.ExcelProjRes.Tables, resTable => resTable.Key, excelResTable => excelResTable.TableTitle, (resTable, excelResTable) => new { ResTable = resTable, ExcelResTable = excelResTable }); foreach (var resource in resourceTablesJoin) { int columnsCount = resource.ExcelResTable.Header.Columns.Count; int culturesCount = columnsCount - 2; List <string> cultureIds = resource.ExcelResTable.Header.Columns .Skip(1) .Select(col => col.Title == InvariantCultureDisplayName ? InvariantCultureId : CultureInfo.GetCultureInfo(col.Title).Name) .Take(culturesCount) .ToList(); List <string> resourceKeys = resource.ExcelResTable.Rows.Select(row => row.DataList[0].DataString).ToList(); List <string> comments = resource.ExcelResTable.Rows.Select(row => row.DataList[columnsCount - 1].DataString).ToList(); Dictionary <string, IReadOnlyCollection <ResourceEntryData> > excelResources = cultureIds .Select((cultureId, index) => new KeyValuePair <string, IReadOnlyCollection <ResourceEntryData> > ( cultureId, resourceKeys.Zip( resource.ExcelResTable.Rows.Select(row => row.DataList[index + 1].DataString), (key, value) => new { Key = key, Value = value }) .Zip(comments, (kvp, comment) => new ResourceEntryData(kvp.Key, kvp.Value, comment)) .ToList() )) .ToDictionary(kvp => kvp.Key, kvp => kvp.Value); var resourceFileTablesJoin = resource.ResTable.Value .Join(excelResources, resData => resData.Key, excelResData => excelResData.Key, (resData, excelResData) => new { ResData = resData.Value, ExcelResData = excelResData.Value }); foreach (var resFileTablesJoin in resourceFileTablesJoin) { try { UpdateResourceFile(resFileTablesJoin.ResData, resFileTablesJoin.ExcelResData); } catch (MissingManifestResourceException ex) { throw new MissingManifestResourceException(String.Format(ErrorsRes.MissingResourcesFormat, project.ProjRes.ProjectId, resFileTablesJoin.ResData.ResourceName, resFileTablesJoin.ResData.Culture.DisplayName), ex); } } } } }
/** * Creates a temporary context to a IDocumentGenerator and writes * the result to disk. */ public void EmitDocument(IDocumentGenerator generator, string uri = null) { var context = GetContext(uri); var result = generator.Generate(context); SavePage(result, uri); }
public void Initialize() { _documentTypeRepositoryMock = DocumentTypeRepositoryMock.GetDocumentTypeRepositoryMock(); _generatedDocumentRepositoryMock = GeneratedDocumentRepositoryMock.GetGeneratedDocumentRepositoryMock(); jsonContent = new GenerateDocumentRequest(); htmlContent = new GenerateDocumentRequest(); htmlGenerator = new DocumentGenerator.Implementations.HtmlGenerator(new DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper()); pdfGenerator = new DocumentGenerator.Implementations.PdfGenerator(); odtGenerator = new DocumentGenerator.Implementations.OdtGenerator(); docxGenerator = new DocumentGenerator.Implementations.DocxGenerator(); generatedDocumentLogger = new DocumentGenerator.Implementations.Helpers.GeneratedDocumentLogger(_generatedDocumentRepositoryMock.Object); templateGenerator = new TemplateGenerator(new DocumentGenerator.Implementations.PdfGenerator(), new DocumentGenerator.Implementations.HtmlGenerator(new DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper())); documentGenerator = new DocumentGenerator.Implementations.Generators.DocumentGenerator(_documentTypeRepositoryMock.Object, generatedDocumentLogger, htmlGenerator, pdfGenerator, odtGenerator, docxGenerator, templateGenerator); _templateVersionRepositoryMock = TemplateVersionRepositoryMock.GetTemplateVersionRepositoryMock(); _folderRepositoryMock = FolderRepositoryMock.GetFolderRepositoryMock(); _templateRepositoryMock = TemplateRepositoryMock.GetTemplateRepositoryMock(); templateVersionManipulation = new TemplateVersionManipulation(_templateVersionRepositoryMock.Object); folderManipulation = new FolderManipulation(_folderRepositoryMock.Object); templateManipulation = new TemplateManipulation(_templateRepositoryMock.Object, templateVersionManipulation, folderManipulation); templateVersionManipulation = new TemplateVersionManipulation(_templateVersionRepositoryMock.Object); exportTemplateManipulation = new ExportTemplateManipulation(templateManipulation, templateVersionManipulation, documentGenerator); }
public ApiDocGenerator(IDocumentGenerator documentGenerator, DocumentTemplate template, DoxygenModel model) { this.dg = documentGenerator; this.sectionLevel = 0; this.Template = template; this.Model = model; }
public static doGenerateDocumentResult Generate(DocumentContext context) { AccountingHandler handler = new AccountingHandler(); doGenerateDocumentResult result = new doGenerateDocumentResult(); try { Assembly assembly = Assembly.Load(context.AssemblyName + ", Version=0.0.0.0, PublicKeyToken=null,Culture=neutral"); Type[] typelist = assembly.GetTypes(); string s = ""; for (int i = 0; i < typelist.Length - 1; i++) { s = s + typelist[i].FullName + ","; } Type type = assembly.GetType(context.TypeName, true); IDocumentGenerator generator = (IDocumentGenerator)Activator.CreateInstance(type); result = generator.GenerateDocument(context); result.DocumentContext = context; return(result); } catch (Exception ex) { throw; } }
protected DocumentCommandHandler(TelegramBotClient botCLient, ImagesRecognitionService imagesRecognitionService, VoiceRecognitionService voiceRecognitionService, IDocumentGenerator generator) : base(botCLient) { _documentGenerator = generator; _voiceRecognitionService = voiceRecognitionService; _imagesRecognitionService = imagesRecognitionService; }
public void DocumentGenerator() { IDocumentGenerator instance = Factory.DocumentGenerator; Assert.That(instance, Is.TypeOf <Generator>()); Generator generator = (Generator)instance; Assert.That(generator.ExternalServices, Is.Not.Null); Assert.That(generator.ExternalServices.ExpressionCompiler, Is.Not.Null); Assert.That(generator.ExternalServices.ExpressionRunner, Is.Not.Null); Assert.That(generator.ExternalServices.ScriptNameResolver, Is.Not.Null); }
/// <summary> /// Генерирует документ и возвращает количество его страниц. /// </summary> /// <param name="documentGenerator">Генератор документов.</param> /// <param name="documentId">Идентификатор документа.</param> /// <param name="userInput">Пользовательский ввод.</param> /// <returns>Количество страниц документа.</returns> private int GenerateDocumentAndGetPagesCount(IDocumentGenerator documentGenerator, int documentId, UserInputDto userInput) { return(documentGenerator.Process(new Dictionary <string, object> { { "UserId", NiisAmbientContext.Current.User.Identity.UserId }, { "RequestId", userInput.OwnerId }, { "DocumentId", documentId }, { "UserInputFields", userInput.Fields }, { "SelectedRequestIds", userInput.SelectedRequestIds }, { "PageCount", userInput.PageCount }, { "OwnerType", userInput.OwnerType }, { "Index", userInput.Index } }).PageCount); }
/// <summary> /// Initializes a new instance of the <see cref="DatabaseObjectToScriptedDirectoryProcessor"/> class. /// </summary> /// <param name="documentGenerator">Document generator to use.</param> /// <param name="basePath">Path to write output.</param> public DatabaseObjectToScriptedDirectoryProcessor(IDocumentGenerator documentGenerator, string basePath) { new { documentGenerator }.AsArg().Must().NotBeNull(); new { basePath }.AsArg().Must().NotBeNullNorWhiteSpace(); this.documentGenerator = documentGenerator; this.databaseDocumenter = new DatabaseDocumenter(this.documentGenerator); this.tablePath = this.CreateDatabaseObjectDirectory("table", basePath); this.sprocPath = this.CreateDatabaseObjectDirectory("sproc", basePath); this.funcPath = this.CreateDatabaseObjectDirectory("function", basePath); this.viewPath = this.CreateDatabaseObjectDirectory("view", basePath); this.securityPath = this.CreateDatabaseObjectDirectory("security", basePath); this.userDefinedDataTypePath = this.CreateDatabaseObjectDirectory("type", basePath); }
public void Initialize() { _documentTypeRepositoryMock = DocumentTypeRepositoryMock.GetDocumentTypeRepositoryMock(); _generatedDocumentRepositoryMock = GeneratedDocumentRepositoryMock.GetGeneratedDocumentRepositoryMock(); jsonContent = new GenerateDocumentRequest(); htmlContent = new GenerateDocumentRequest(); htmlGenerator = new DocumentGenerator.Implementations.HtmlGenerator(new DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper()); pdfGenerator = new DocumentGenerator.Implementations.PdfGenerator(); _docxGeneratorMock = DocxGeneratorMock.GetDocxGeneratorMock(); _odtGeneratorMock = OdtGeneratorMock.GetOdtGeneratorMock(); generatedDocumentLogger = new DocumentGenerator.Implementations.Helpers.GeneratedDocumentLogger(_generatedDocumentRepositoryMock.Object); templateGenerator = new TemplateGenerator(new DocumentGenerator.Implementations.PdfGenerator(), new DocumentGenerator.Implementations.HtmlGenerator(new DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper())); documentGenerator = new DocumentGenerator.Implementations.Generators.DocumentGenerator(_documentTypeRepositoryMock.Object, generatedDocumentLogger, htmlGenerator, pdfGenerator, _odtGeneratorMock.Object, _docxGeneratorMock.Object, templateGenerator); setJsonContent(); setHtmlContent(); controller = new DocumentGeneratorController(documentGenerator, generatedDocumentLogger); }
/// <summary> /// Initializes a new instance of the <see cref="SwaggerGenerator"/> class. /// </summary> /// <param name="apiDescriptionsProvider"><see cref="IApiDescriptionGroupCollectionProvider"/> for providing API descriptions.</param> /// <param name="schemaRegistryFactory"><see cref="ISchemaRegistryFactory"/> for creating schema registries.</param> /// <param name="optionsAccessor"><see cref="IOptions{T}"/> for <see cref="SwaggerGeneratorOptions"/>.</param> /// <param name="eventDocumentGenerator"><see cref="IDocumentGenerator{T}"/> for <see cref="IEvent"/>.</param> /// <param name="commandDocumentGenerator"><see cref="IDocumentGenerator{T}"/> for <see cref="ICommand"/>.</param> /// <param name="queryDocumentGenerator"><see cref="IDocumentGenerator{T}"/> for <see cref="IQuery"/>.</param> public SwaggerGenerator( IApiDescriptionGroupCollectionProvider apiDescriptionsProvider, ISchemaRegistryFactory schemaRegistryFactory, IOptions <SwaggerGeneratorOptions> optionsAccessor, IDocumentGenerator <IEvent> eventDocumentGenerator, IDocumentGenerator <ICommand> commandDocumentGenerator, IDocumentGenerator <IQuery> queryDocumentGenerator) { _apiDescriptionsProvider = apiDescriptionsProvider; _schemaRegistryFactory = schemaRegistryFactory; _eventDocumentGenerator = eventDocumentGenerator; _commandDocumentGenerator = commandDocumentGenerator; _queryDocumentGenerator = queryDocumentGenerator; _options = optionsAccessor.Value; ConfigureGenerators(); _originalGenerator = new OriginalSwaggerGenerator(_apiDescriptionsProvider, _schemaRegistryFactory, _options); }
private static void ScriptObjects(Database database, IDocumentGenerator documentGenerator, string databasePath, Action <string> announcer) { DatabaseObjectToScriptedDirectoryProcessor databaseObjectToScriptedDirectoryProcessor = new DatabaseObjectToScriptedDirectoryProcessor(documentGenerator, databasePath); documentGenerator.AddEntry(database.Name + " - Object Documentation", 18, true, Alignment.Center); announcer(">Tables"); databaseObjectToScriptedDirectoryProcessor.Process(database.Tables); announcer("<Tables"); announcer(">Views"); databaseObjectToScriptedDirectoryProcessor.Process(database.Views); announcer(">Views"); announcer(">Roles"); databaseObjectToScriptedDirectoryProcessor.Process(database.Roles); announcer("<Roles"); announcer(">Stored Procedures"); databaseObjectToScriptedDirectoryProcessor.Process(database.StoredProcedures); announcer("<Stored Procedures"); announcer(">User Defined Functions"); databaseObjectToScriptedDirectoryProcessor.Process(database.UserDefinedFunctions); announcer("<User Defined Functions"); announcer(">User Defined Data Types"); databaseObjectToScriptedDirectoryProcessor.Process(database.UserDefinedDataTypes); announcer("<User Defined Data Types"); announcer(">Users"); databaseObjectToScriptedDirectoryProcessor.Process(database.Users); announcer("<Users"); announcer(">Remove of empty directories"); databaseObjectToScriptedDirectoryProcessor.CleanUpEmptyDirectories(); announcer("<Remove of empty directories"); }
/// <summary> /// Constructor for DocumentGeneratorController. Place of dependency injection. /// </summary> public DocumentGeneratorController(IDocumentGenerator documentGenerator, IGeneratedDocumentLogger logger) { _documentGenerator = documentGenerator; _logger = logger; }
public ResponseHelper(IDocumentGenerator documentGenerator, IAsyncApiSerializer serializer) { this.documentGenerator = documentGenerator; this.serializer = serializer; }
public ExportTemplateManipulation(ITemplateManipulation templateManipulation, ITemplateVersionManipulation templateVersionManipulation, IDocumentGenerator documentGenerator) { _templateManipulation = templateManipulation; _templateVersionManipulation = templateVersionManipulation; _documentGenerator = documentGenerator; }
public void testIfEqual(string controll, string testValue, IDocumentGenerator dg) { writeAfterRead = false; string result = read(controll, dg); if (result.Equals(testValue)) { dg.BeginMarkup(DocumentMarkupKind.Success); dg.PrintText(testValue); dg.EndMarkup(DocumentMarkupKind.Success); } else { dg.BeginMarkup(DocumentMarkupKind.Fail); dg.PrintText(testValue); dg.BeginMarkup(DocumentMarkupKind.Emphasis); dg.PrintText(" " + result); dg.EndMarkup(DocumentMarkupKind.Emphasis); dg.EndMarkup(DocumentMarkupKind.Fail); } }
public override void print(IDocumentGenerator dg, int sectionLevel) { dg.BeginTable(RowCount, ColCount); try { int rowIndex = 0; foreach (var tr in Rows) { dg.BeginTableRow(rowIndex); try { int colIndex = 0; foreach (var tc in tr.Cells) { dg.BeginTableCell(rowIndex, colIndex, tc.IsHeader); try { foreach (var p in tc.Paragraphs) { p.print(dg, sectionLevel); } } catch (Exception e) { Console.WriteLine(e.Message); } finally { dg.EndTableCell(rowIndex, colIndex, tc.IsHeader); } ++colIndex; } } catch { Console.WriteLine("Error while make table"); } finally { dg.EndTableRow(rowIndex); ++rowIndex; } } } finally { dg.EndTable(); } }
public override void print(IDocumentGenerator dg, int sectionLevel) { foreach (var c in Commands) { c.print(dg, sectionLevel); } dg.NewParagraph(); }
public void CleanUp(IDatabase db, IDocumentGenerator dg) { db.BulkDelete(dg.GetDocumentsForMeasurement); }
public override void print(IDocumentGenerator dg, int sectionLevel) { if (Title != null) { dg.BeginSectionTitle(sectionLevel, Title, null); dg.EndSectionTitle(); } else { switch (SimpleSectKind) { case DocSimpleSectKind.See: case DocSimpleSectKind.Return: case DocSimpleSectKind.Author: case DocSimpleSectKind.Authors: case DocSimpleSectKind.Version: case DocSimpleSectKind.Since: case DocSimpleSectKind.Date: case DocSimpleSectKind.Note: case DocSimpleSectKind.Warning: case DocSimpleSectKind.Pre: case DocSimpleSectKind.Post: case DocSimpleSectKind.Copyright: case DocSimpleSectKind.Invariant: case DocSimpleSectKind.Remark: case DocSimpleSectKind.Attention: case DocSimpleSectKind.Par: case DocSimpleSectKind.Rcs: dg.BeginSectionTitle(sectionLevel, SimpleSectKind.ToString(), null); dg.EndSectionTitle(); break; default: Console.WriteLine("WARNING: unsupported simple section kind: DocSimpleSectKind." + SimpleSectKind); break; } } sectionLevel++; try { foreach (var item in Items) { item.print(dg, sectionLevel); } } finally { sectionLevel--; } }
public override void print(IDocumentGenerator dg, int sectionLevel) { if (Compound != null || Member != null || referenceID != null) { switch (RefKind) { case DocRefKind.Compound: dg.BeginReference(Compound.Identifier, false); break; case DocRefKind.Member: dg.BeginReference(Member.Identifier, false); break; case DocRefKind.CustomID: dg.BeginReference(referenceID, true); break; default: Console.WriteLine("WARNING: unsupported reference kind: " + RefKind); break; } } try { if (Commands.Count > 0) { foreach (var command in Commands) { command.print(dg, sectionLevel); } } else if (Compound != null || Member != null) { string name = null; switch (RefKind) { case DocRefKind.Compound: name = Compound.Name; break; case DocRefKind.Member: name = Member.Name; break; default: Console.WriteLine("WARNING: unsupported reference kind: DocRefKind." + RefKind); break; } if (name != null) { name = NormalizeName(name); } new DocText() { TextKind = DocTextKind.Plain, Text = name }.print(dg, sectionLevel); } } finally { dg.EndReference(); } }
public TestReportDocGenerator(IDocumentGenerator documentGenerator, TestResults testResults) { this.dg = documentGenerator; this.testResults = testResults; }
public override void print(IDocumentGenerator dg, int sectionLevel) { dg.BeginReference(Url, true); try { foreach (var command in Commands) { command.print(dg, sectionLevel); } } finally { dg.EndReference(); } }
public override void print(IDocumentGenerator dg, int sectionLevel) { switch (TextKind) { case DocTextKind.Plain: dg.PrintText(Text); break; case DocTextKind.Verbatim: dg.PrintVerbatimText(Text); break; default: Console.WriteLine("WARNING: unsupported text kind:" + TextKind); break; } }
public DocPrinter(IDocumentGenerator generator, DoxygenModel model) { this.dg = generator; this.Model = model; this.sectionLevel = 0; }
public override void execute(IDocumentGenerator dg, int sectionLevel) { if (decisionCommand.execute()) { foreach (var command in trueCommand) { command.execute(dg,sectionLevel); } } else { foreach (var command in falseCommand) { command.execute(dg, sectionLevel); } } }
public string read(string controll, IDocumentGenerator dg) { string[] findBy = controll.Split(':', ';'); IWebElement query; IList<IWebElement> queries = new List<IWebElement>(); for (int i = 0; i < findBy.Count(); i = i + 2) { string type = findBy[i].Replace(" ", string.Empty); string searchsequence = findBy[i + 1]; if (type.ToLower() == "id") { query = webdriver.FindElement(By.Id(searchsequence)); break; } else if (type.ToLower() == "classname") { if (queries.Count == 0) { queries = webdriver.FindElements(By.ClassName(searchsequence)); } else { queries = queries.Where(webelement => webelement.GetAttribute("class") == searchsequence).ToList(); } } else if (type.ToLower() == "tagname") { if (queries.Count == 0) { queries = webdriver.FindElements(By.TagName(searchsequence)); } else { queries = queries.Where(webelement => webelement.TagName == searchsequence).ToList(); } } else if (type.ToLower() == "name") { if (queries.Count == 0) { queries = webdriver.FindElements(By.Name(searchsequence)); } else { queries = queries.Where(webelement => webelement.GetAttribute("name") == searchsequence).ToList(); } } } if (queries.Count == 1) { query = queries.First(); } else if (queries.Count > 0) { Console.WriteLine("Controll isn't enought specific! The first of the matching elements will be selected"); query = queries.First(); } else { throw new NotFoundException(); } if (writeAfterRead) { dg.PrintText(query.Text); return null; } else { return query.Text; } }
public override void print(IDocumentGenerator dg, int sectionLevel) { switch (MarkupKind) { case DocMarkupKind.Bold: dg.BeginMarkup(DocumentMarkupKind.Bold); break; case DocMarkupKind.Emphasis: dg.BeginMarkup(DocumentMarkupKind.Emphasis); break; case DocMarkupKind.SubScript: dg.BeginMarkup(DocumentMarkupKind.SubScript); break; case DocMarkupKind.SuperScript: dg.BeginMarkup(DocumentMarkupKind.SuperScript); break; case DocMarkupKind.Center: dg.BeginMarkup(DocumentMarkupKind.Center); break; case DocMarkupKind.ComputerOutput: dg.BeginMarkup(DocumentMarkupKind.ComputerOutput); break; case DocMarkupKind.Preformatted: dg.BeginMarkup(DocumentMarkupKind.Preformatted); break; default: Console.WriteLine("Unsupported Markup:" + this.MarkupKind); break; } try { foreach (var Command in Commands) { Command.print(dg, sectionLevel); } } finally { switch (MarkupKind) { case DocMarkupKind.Bold: dg.EndMarkup(DocumentMarkupKind.Bold); break; case DocMarkupKind.Emphasis: dg.EndMarkup(DocumentMarkupKind.Emphasis); break; case DocMarkupKind.SubScript: dg.EndMarkup(DocumentMarkupKind.SubScript); break; case DocMarkupKind.SuperScript: dg.EndMarkup(DocumentMarkupKind.SuperScript); break; case DocMarkupKind.Center: dg.EndMarkup(DocumentMarkupKind.Center); break; case DocMarkupKind.ComputerOutput: dg.EndMarkup(DocumentMarkupKind.ComputerOutput); break; case DocMarkupKind.Preformatted: dg.EndMarkup(DocumentMarkupKind.Preformatted); break; default: Console.WriteLine("Unsupported Markup:" + this.MarkupKind); break; } } }
public void print(IDocumentGenerator dg, int sectionLevel) { if (Title != null) { dg.BeginSectionTitle(sectionLevel, Title, null); dg.EndSectionTitle(); sectionLevel = sectionLevel + 1; } try { foreach (var para in Paragraphs) { para.print(dg, sectionLevel); } foreach (var sect in Sections) { sect.print(dg, sectionLevel); } } finally { if (Title != null) { sectionLevel = sectionLevel - 1; } } }
public override void print(IDocumentGenerator dg, int sectionLevel) { foreach (var p in Paragraphs) { p.print(dg, sectionLevel); } if (Separator != null) { Separator.print(dg, sectionLevel); } }
public TestDocPrinter(IDocumentGenerator generator) { this.dg = generator; this.sectionLevel = 0; }
public override void print(IDocumentGenerator dg, int sectionLevel) { Console.WriteLine("WARNING: unsupported text kind:" + CharKind); }
public Task ImportFromDocumentAsync(IDocumentGenerator documentGenerator, string path, IReadOnlyCollection <string> selectedCultures, IReadOnlyCollection <Project> selectedProjects, IStatusProgress progress, CancellationToken cancellationToken) { return(Task.Run(() => ImportFromDocument(documentGenerator, path, selectedCultures, selectedProjects, progress, cancellationToken), cancellationToken)); }
public virtual void print(IDocumentGenerator dg, int sectionLevel) { //throw new InvalidOperationException("DocCmd can't be printed!"); }
public async Task ExportToDocumentAsync(IDocumentGenerator documentGenerator, string path, IReadOnlyCollection <string> selectedCultures, IReadOnlyCollection <Project> selectedProjects, IStatusProgress progress, CancellationToken cancellationToken) { progress.Report(StatusRes.GettingProjectsResources); SolutionResources solutionResources = await GetSolutionResourcesAsync(selectedCultures, selectedProjects, progress, cancellationToken); progress.Report(StatusRes.PreparingResourcesToExport); var cultures = selectedCultures.Select(CultureInfo.GetCultureInfo) .ToDictionary( cult => cult.Name, cult => cult.Name == InvariantCultureId ? InvariantCultureDisplayName : cult.Name.ToUpper() ); var culturesOrder = new List <string>(cultures.Count) { InvariantCultureId }; culturesOrder.AddRange(cultures.Where(cult => cult.Key != InvariantCultureId).OrderBy(cult => cult.Value).Select(cult => cult.Key)); var header = new HeaderModel { Columns = new List <ColumnModel>(1) { new ColumnModel { Title = ExcelRes.ResourceKey } } .Concat(culturesOrder.Select(cultureId => cultures[cultureId]).Select(headerName => new ColumnModel { Title = headerName })) .Concat(new List <ColumnModel>(1) { new ColumnModel { Title = ExcelRes.Comment } }) .ToList() }; IReadOnlyList <ResGroupModel <ResExcelModel> > groups = solutionResources .ProjectResources.Select(proj => new ResGroupModel <ResExcelModel> { GroupTitle = proj.ProjectName, Tables = proj.Resources.Select(res => { var neutralResources = res.Value[InvariantCultureId].StringResources; List <string> keysOrder = neutralResources.Keys.OrderBy(key => key).ToList(); List <RowModel <ResExcelModel> > rows = keysOrder.Select( resKey => new RowModel <ResExcelModel> { Model = new ResExcelModel(resKey, culturesOrder.Select(cultureId => res.Value[cultureId]).Select(resData => resData.StringResources[resKey].Value).ToList(), res.Value[InvariantCultureId].StringResources[resKey].Comment) }) .Where(r => r.Model.ResourceValues.Count != 0) .ToList(); var tableModel = new ResTableModel <ResExcelModel> { TableTitle = res.Key, Header = header, Rows = rows }; cancellationToken.ThrowIfCancellationRequested(); return(tableModel); }) .Where(table => table.Rows.Count != 0) .ToList() }) .Where(res => res.Tables.Count != 0) .ToList(); await documentGenerator.ExportToDocumentAsync(path, groups, progress, cancellationToken); }
public override void print(IDocumentGenerator dg, int sectionLevel) { foreach (var command in Commands) { command.print(dg, sectionLevel); } }
public override void print(IDocumentGenerator dg, int sectionLevel) { execute(dg,sectionLevel); }
public override void print(IDocumentGenerator dg, int sectionLevel) { Console.WriteLine("WARNING: unsupported empty kind: DocEmptyKind." + EmptyKind); }
public virtual void execute(IDocumentGenerator dg, int sectionLevel) { Type type; if (sc == null && aic == null) { type = typeof(Command); } else if(sc == null) { type = typeof(AutoItController); } else { type = typeof(SeleniumController); } MethodInfo method = type.GetMethod(commandName); if(method == null) { Console.WriteLine("Invalid commandname: "+commandName +". This command will be skipped."); return; } paramteters = new Dictionary<string, object>(); paramteters.Add("dg", dg); foreach (var variable in parameter.Split(',').Where(p => !string.IsNullOrEmpty(p))) { string paramName = variable.Split('=')[0]; string paramValue = variable.Split('=')[1]; if(paramValue.StartsWith("$")) { variables.TryGetValue(paramValue.Substring(1), out paramValue); } paramteters.Add(paramName, paramValue); } var arguments = method.GetParameters().Select(p => paramteters[p.Name]).ToArray(); string result; if (sc == null && aic == null) { result = (string)method.Invoke(this, arguments); } else if (sc == null) { result = (string)method.Invoke(aic, arguments); } else { result = (string)method.Invoke(sc, arguments); } Console.WriteLine(result); }
public AsyncApiDocumentProvider(IDocumentGenerator documentGenerator, IServiceProvider serviceProvider) { _documentGenerator = documentGenerator; _serviceProvider = serviceProvider; }
public override void print(IDocumentGenerator dg, int sectionLevel) { if (Commands.Count > 0) { dg.BeginSectionTitle(sectionLevel, "", null); foreach (var c in Commands) { c.print(dg, sectionLevel); } dg.EndSectionTitle(); } }
public string read(string title, string controll, IDocumentGenerator dg) { throw new NotImplementedException(); }
public DocumentBusiness(DataContext context, IIntakeFormBusiness intakeFormBusiness, IDocumentGenerator exporter) { _context = context; _intakeFormBusiness = intakeFormBusiness; _exporter = exporter; }
public override void print(IDocumentGenerator dg, int sectionLevel) { dg.AddImage(Path, Width, Height); }
/// <summary> /// Initializes a new instance of the <see cref="DatabaseDocumenter"/> class. /// </summary> /// <param name="documentGenerator">Document generator to actually persist the information.</param> public DatabaseDocumenter(IDocumentGenerator documentGenerator) { this.documentGenerator = documentGenerator; }
public override void print(IDocumentGenerator dg, int sectionLevel) { dg.BeginList(); try { int listItemIndex = 0; foreach (var li in Items) { dg.BeginListItem(listItemIndex, null); try { foreach (var p in li.Paragraphs) { p.print(dg, sectionLevel); } } finally { dg.EndListItem(listItemIndex); } ++listItemIndex; } } finally { dg.EndList(); } }
public AsyncApiDocumentProvider(IOptions <AsyncApiOptions> options, IDocumentGenerator documentGenerator) { _documentGenerator = documentGenerator; _options = options?.Value ?? throw new ArgumentNullException(nameof(options)); }
public PdfProductFormatter(IDocumentGenerator documentGenerator, XmlProductFormatter xmlFormatter) { _documentGenerator = documentGenerator; _xmlFormatter = xmlFormatter; }