
Changed code to use log Info Changed code to append error messages rather than replace text Added/Changed code to use Log4Net. Changed logic for Updates to Use IDs rather than Objects for internal Updates Added a FormatColumn token to handle DTS, Added comments to describe tokens Added methods ParentRefU and ParentRefU2 to support otther changes
59 lines
1.2 KiB
C#
59 lines
1.2 KiB
C#
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<string> _MyErrors = new List<string>();
|
|
public List<string> 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;
|
|
}
|
|
}
|
|
} |