using System.IO;
using ToolsOffice.Interfaces.Word.Models;
using ToolsOffice.Interfaces.Word.Models.Cases;
namespace ToolsOffice.Interfaces.Word
{
public abstract class BuilderWordDocument
{
public Stream CreateDocumentWithTable(ModelWordDocumentWithHeaderAndTable model)
{
if (model == null || model.Document == null || model.Header == null || model.Table == null)
{
return null;
}
CreateDocument(model.Document);
CreateParagraph(model.Header);
CreateTable(model.Table);
return SaveDocument(model.Document);
}
///
/// Создание документа
///
///
public abstract void CreateDocument(ModelWordDocument model);
///
/// Создание абзаца с текстом
///
///
public abstract void CreateParagraph(ModelWordParagraph model);
///
/// Создание абзаца с текстом
///
///
public abstract void CreateTable(ModelWordTable model);
///
/// Сохранение файла
///
///
public abstract Stream SaveDocument(ModelWordDocument info);
}
}