internal string getXmlStartList(RaceRun raceRun) { using (var sw = new Utf8StringWriter()) { using (var xw = XmlWriter.Create(sw, _xmlSettings)) { xw.WriteStartDocument(); xmlWriteStartElementLivetiming(xw); xw.WriteStartElement("startlist"); xw.WriteAttributeString("runno", raceRun.Run.ToString()); StartListViewProvider slp = raceRun.GetStartListProvider(); var startList = slp.GetViewList(); int i = 1; foreach (var sle in startList) { // Skip participants which are not "FIS compliant" if (checkParticipantFisCompliant(sle.Participant)) { xw.WriteStartElement("racer"); xw.WriteAttributeString("order", i.ToString()); xw.WriteElementString("bib", sle.StartNumber.ToString()); xw.WriteElementString("lastname", sle.Name); xw.WriteElementString("firstname", sle.Firstname); xw.WriteElementString("nat", sle.Nation); xw.WriteElementString("fiscode", sle.Code); xw.WriteEndElement(); // racer i++; } } xw.WriteEndElement(); // startlist xw.WriteEndElement(); // Livetiming xw.WriteEndDocument(); } return(sw.ToString()); } }
internal string getStartListData(RaceRun raceRun) { string result = ""; StartListViewProvider slp = raceRun.GetStartListProvider(); var startList = slp.GetViewList(); foreach (var sle in startList) { string item; item = string.Format("{0,3}", sle.Participant.Id); if (!string.IsNullOrEmpty(result)) { result += "\n"; } result += item; } return(result); }