using BusinessLogic.OfficePackage.HelperEnums; using BusinessLogic.OfficePackage.HelperModels; using DocumentFormat.OpenXml.Wordprocessing; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BusinessLogic.OfficePackage { public abstract class AbstractSaveToWordImplementer { public void CreateDoc(WordInfoImplementer info) { CreateWord(info); CreateParagraph(new WordParagraph { Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) }, TextProperties = new WordTextProperties { Size = "24", JustificationType = WordJustificationType.Both } }); foreach (var report in info.Workshops) { CreateNumberedParagraph(1, 0, report.DetailName); foreach (var workshop in report.WorkShops) { CreateNumberedParagraph(1, 1, workshop); } } SaveWord(info); } protected abstract void CreateWord(WordInfoImplementer info); protected abstract void CreateParagraph(WordParagraph paragraph); protected abstract void CreateNumberedParagraph(int numId, int ilvl, string text); protected abstract void SaveWord(WordInfoImplementer info); } }