Пример #1
0
        private void ParseRawLine(string line)
        {
            // skip comment line
            if (line.StartsWith("#") || line.Length < 4)
            {
                return;
            }

            string[] cols = line.Split(" ".ToCharArray(), 9);

            // if normal key
            if (cols.Length == 9)
            {
                MyRow r = new MyRow();
                r.Set(cols);
                Rows.Add(r);
            }
            // if dx key
            else
            {
                MyRowDx dx = new MyRowDx();
                dx.Set(cols);

                LinkDx(dx);
            }
        }
Пример #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (textbox1Changed)
            {
                TimeSpan ts = DateTime.Now - textbox1ChangedTime;
                if (ts.TotalSeconds > 2)
                {
                    textbox1Changed = false;
                    FindName(textBox1.Text);
                }
            }

            int pressedButton = dmanager.PollButton();

            if (pressedButton >= 0)
            {
                Console.WriteLine(pressedButton.ToString());
                MyRow res = FindDx(pressedButton);
                if (res != null)
                {
                    FindColumn(2, res.Name(), false);
                }
            }
        }