20 InitializeComponent();
26 if (CheckLedControlFile(Filename))
28 Console.WriteLine(
"LedControl file {0} seems to be ok.", Filename);
36 Console.WriteLine(
"WARNING: Found some issues in ledcontrol file: {0}", Filename);
42 private void SelectLedControlFile_Click(
object sender, EventArgs e)
45 if (OpenLedControlFile.ShowDialog() == DialogResult.OK)
47 Filename = OpenLedControlFile.FileName;
48 CheckLedControlFile(Filename);
55 private bool CheckLedControlFile(
string Filename)
60 LedControlFileName.Text = Filename;
62 ParsingResults.Rows.Clear();
64 string TempLogFile = Path.GetTempFileName();
75 File.Delete(TempLogFile);
77 foreach (
string LogLine
in LedControlLoadingLog.Split(
new[] {
'\r',
'\n' }))
79 string[] Parts = LogLine.Split(
'\t');
82 if (Parts[1].ToLowerInvariant().Contains(
"exception") || Parts[1].ToLowerInvariant().Contains(
"warning") || Parts[1].ToLowerInvariant().Contains(
"error"))
87 int RowIndex = ParsingResults.Rows.Add();
88 ParsingResults[0, RowIndex].Value = Parts[0];
89 ParsingResults[1, RowIndex].Value = Parts[1];
97 ParsingResults.Rows.Clear();
98 MessageBox.Show(
"A error has occured when trying to load and parse the ledcontrol file: \n{0}\n\nException:\n{1}".Build(Filename, E.Message));
Static class to read files.
static void Finish()
Finishes the logger. Closes the log file.
LedControlFileTestWizard()
Initializes a new instance of the LedControlFileTestWizard class.
LedControlFileTestWizard(string Filename)
static void Init()
Initializes the log using the file defnied in the Filename property.
A simple logger used to record important events and exceptions.
Namespace for the LedControlFileTester application.
The DirectOutput.LedControl namespace contains the classes to read and understand the classical LedCo...
Ledcontrol configuration read from a ledcontrol.ini file.
static string Filename
Gets or sets the filename for the log.
This is the main form of the LedControlFileTester application. It contains all functionality of the...
The namespace DirectOutput.General contains classes for general use.