private static List<Encode> loadUnicodes()
{
List<Encode> encodes = new List<Encode>();
unicodeFile = Application.StartupPath + "\\unicodes.txt";
StreamReader sr = new StreamReader(unicodeFile);
TextReader tr = sr;
while (!sr.EndOfStream)
{
string line = tr.ReadLine();
// ignore comments and blank lines
if (!line.Trim().StartsWith(";") && line.Trim().Length > 0)
{
string[] ss = line.Split(' ');
if (line.Contains('"'))
{
int strStart = line.IndexOf('"');
ss[3] = line.Substring(
strStart,
(int)Math.Min(
(uint)line.IndexOf('"', strStart + 1) - strStart + 1,
(uint)line.Length - strStart
));
}
try
{
Encode enc = new Encode(
new byte[] {
byte.Parse(ss[0].Replace(",", "").Trim()),
byte.Parse(ss[1].Replace(",", "").Trim()),
byte.Parse(ss[2].Replace(",", "").Trim())
}, ss[3]);
encodes.Add(enc);
}
catch
{
}
}
}
sr.Close();
return encodes;
}