public void WriteJson(TStringList ML) { EventDataJson obj = GetEventDataJson(); string s = JsonConvert.SerializeObject(obj, Formatting.Indented); ML.Text = s; }
public EventDataJson GetEventDataJson() { EventDataJson o = new EventDataJson(); List <string[]> temp; o.EventParams = GetEventParams(); o.EventProps = GetEventProps(); o.NameTable = GetNames(); o.StartList = GetStartList(); o.FleetList = GetFleetList(); o.FinishInfo = GetFinishList(); if (BO.BOParams.itCount > 0 || BO.EventProps.isTimed) { temp = GetTimeLists(); if (temp != null) { o.TimingInfo = temp.ToArray(); } } else { o.TimingInfo = new List <string[]>().ToArray(); } o.PenaltyInfo = GetPenaltyLists().ToArray(); return(o); }
public string[] ConvertEventDataJson(EventDataJson o) { List <string> a = new List <string>(); foreach (string s in o.EventParams) { a.Add(s); } foreach (string s in o.EventProps) { a.Add(s); } if (o.NameTable.Length > 2) { foreach (string s in o.NameTable) { a.Add(s); } } foreach (string s in o.StartList) { a.Add(s); } if (o.FleetList.Length > 2) { foreach (string s in o.FleetList) { a.Add(s); } } foreach (string s in o.FinishInfo) { a.Add(s); } if (o.TimingInfo != null && o.TimingInfo.Length > 0) { foreach (var ti in o.TimingInfo) { foreach (string s in ti) { a.Add(s); } } } if (o.PenaltyInfo != null && o.PenaltyInfo.Length > 0) { foreach (var pi in o.PenaltyInfo) { foreach (string s in pi) { a.Add(s); } } } return(a.ToArray()); }
public string[] GetEventData() { EventDataJson o = GetEventDataJson(); return(ConvertEventDataJson(o)); }