using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; namespace DataLoader { public partial class frmErrors : Form { private Form _MyParent; public frmErrors(Form myParent) { InitializeComponent(); _MyParent = myParent; } private List _MyErrors = new List(); public List MyErrors { get { return _MyErrors; } } string sep = ""; public void Add(string err) { _MyErrors.Add(err); tbErrors.SelectionStart = tbErrors.TextLength; tbErrors.SelectedText = sep + err; sep = "\r\n"; Show(); Application.DoEvents(); } public void Clear() { tbErrors.Text = ""; sep = ""; Hide(); } private void frmErrors_Load(object sender, EventArgs e) { Rectangle rec = Screen.GetWorkingArea(this); Top = _MyParent.Top; Left = _MyParent.Right + Width > rec.Right ? rec.Right - Width : _MyParent.Right; } public void Save(string path) { StreamWriter fs = new StreamWriter(path,false); foreach (string txt in MyErrors) fs.WriteLine(txt); fs.Close(); } public int ItemCount() { return MyErrors.Count; } } }