Exemplo n.º 1
0
        private void CSVMenuItem_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.CheckFileExists = true;
            ofd.Filter          = "CSV-Dateien|*.csv";
            var res = ofd.ShowDialog();

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                string[] lines = System.IO.File.ReadAllLines(ofd.FileName);
                foreach (string line in lines)
                {
                    try
                    {
                        TLookup.Add(line.Split(',')[0], int.Parse(line.Split(',')[1]));
                    }
                    catch (Exception ex)
                    {
                        Logging.Log.Instance.Warn("Adding csv based transponder failed:");
                        Logging.Log.Instance.Error(ex.ToString());
                    }
                }
            }
            MenuItem_Click(sender, e);
        }
Exemplo n.º 2
0
        private void AddMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var  ted = new TransponderEntryDialog();
            bool?res = ted.ShowDialog();

            if (res.HasValue && res.Value)
            {
                TLookup.Add(ted.Code, ted.Startnummer);
            }
            MenuItem_Click(sender, e);
        }