using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Components { public partial class UserControlTableDocument : Component { public UserControlTableDocument() { InitializeComponent(); } public UserControlTableDocument(IContainer container) { container.Add(this); InitializeComponent(); } public void SaveToDocument(string filePath, string header, List tables) { if (string.IsNullOrEmpty(filePath)) throw new ArgumentNullException("Empty string instead of path to file"); if (string.IsNullOrEmpty(header)) throw new ArgumentNullException("Header string is empty"); if (tables.Count == 0) throw new ArgumentNullException("Table list is empty"); SaveToPdf saver = new SaveToPdf(); saver.CreateDoc(filePath, header, tables); } } }