using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using static System.Runtime.InteropServices.JavaScript.JSType; namespace Components.Nonvisual { public partial class UserControlHist : Component { public UserControlHist() { InitializeComponent(); } public UserControlHist(IContainer container) { container.Add(this); InitializeComponent(); } public void CreateHist(string filePath, string title, string histTitle, LegendAlignment alignment, Dictionary data) { if (string.IsNullOrEmpty(filePath)) throw new ArgumentException("Filename cannot be empty"); if (string.IsNullOrEmpty(title)) throw new ArgumentException("Title cannot be empty"); if (string.IsNullOrEmpty(histTitle)) throw new ArgumentException("Hist title cannot be empty"); if (data.Count == 0) throw new ArgumentException("Data cannot be empty"); SaveToPdf saver = new SaveToPdf(); saver.CreateHist(filePath, title, histTitle, alignment, data); } } }