public void TestFinishPunchDetected()
        {
            RadioControl[] radioControls;
            var            runners = IofXmlParser.ParseFile(TestHelpers.GetPathToTestFile("splitsResult_Kugler_Johann_in_Finish.xml"),
                                                            delegate(string msg)
            {
            }, false,
                                                            new IofXmlParser.IDCalculator(0).CalculateID, true, out radioControls);


            var runner = runners.First(x => x.Name == "Johann Kugler");

            Assert.AreEqual(0, runner.Status);
            Assert.AreEqual(107600, runner.Time);
        }
Exemple #2
0
        void fileSystemWatcher1_Changed(object sender, FileSystemEventArgs e)
        {
            string filename     = e.Name;
            string fullFilename = e.FullPath;

            Logit(filename + " changed..");
            bool processed = false;

            for (int i = 0; i < 10; i++)
            {
                try
                {
                    RadioControl[] radioControls;
                    var            runners = IofXmlParser.ParseFile(fullFilename, Logit, new IofXmlParser.IDCalculator(m_compid).CalculateID, chkAutoCreateRadioControls.Checked, out radioControls);
                    processed = true;

                    foreach (EmmaMysqlClient c in m_clients)
                    {
                        if (radioControls != null)
                        {
                            c.MergeRadioControls(radioControls);
                        }
                        c.UpdateCurrentResultsFromNewSet(runners);
                    }
                }
                catch (Exception ee)
                {
                    Logit(ee.Message);
                }

                if (!processed)
                {
                    Thread.Sleep(1000);
                }
                else
                {
                    break;
                }
            }
            if (!processed)
            {
                Logit("Could not open " + filename + " for processing");
            }
        }