本文整理汇总了C#中Newtonsoft.Json.Linq.JProperty.Values方法的典型用法代码示例。如果您正苦于以下问题:C# JProperty.Values方法的具体用法?C# JProperty.Values怎么用?C# JProperty.Values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Newtonsoft.Json.Linq.JProperty
的用法示例。
在下文中一共展示了JProperty.Values方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImportLines
private void ImportLines(LocationStop ActuallLocationStop, JProperty Start)
{
foreach (JObject LinProp in Start.Values().ToList())
{
TrafficLine ActuallTrafficLine = new TrafficLine();
ActuallTrafficLine.Parent = ActuallLocationStop;
ActuallLocationStop.TrafficLines.Add(ActuallTrafficLine);
foreach (JProperty LinLinProp in LinProp.Properties())
{
if (LinLinProp.Name == "name")
{
ActuallTrafficLine.Name = LinLinProp.Value.ToString();
continue;
}
if (LinLinProp.Name == "towards")
{
ActuallTrafficLine.Towards = LinLinProp.Value.ToString();
continue;
}
if (LinLinProp.Name == "direction")
{
ActuallTrafficLine.Direction = LinLinProp.Value.ToString();
continue;
}
if (LinLinProp.Name == "platform")
{
ActuallTrafficLine.PlatForm = LinLinProp.Value.ToString();
continue;
}
if (LinLinProp.Name == "richtungsId")
{
ActuallTrafficLine.RichtungsID = LinLinProp.Value.ToString();
continue;
}
if (LinLinProp.Name == "barrierFree")
{
ActuallTrafficLine.BarriereFrei = LinLinProp.Value.ToObject<bool>();
continue;
}
if (LinLinProp.Name == "realtimeSupported")
{
ActuallTrafficLine.RealTimeSupported = LinLinProp.Value.ToObject<bool>();
continue;
}
if (LinLinProp.Name == "trafficjam")
{
ActuallTrafficLine.TrafficJam = LinLinProp.Value.ToObject<bool>();
continue;
}
if (LinLinProp.Name == "departures")
{
ImportDeparture(ActuallTrafficLine, LinLinProp);
continue;
}
if (LinLinProp.Name == "type")
{
LineType Output;
if (Enum.TryParse(LinLinProp.Value.ToString(), true, out Output))
ActuallTrafficLine.LiType = Output;
else
ActuallTrafficLine.LiType = LineType.Error;
continue;
}
if (LinLinProp.Name == "lineId")
{
ActuallTrafficLine.LineID = LinLinProp.Value.ToObject<Int32>();
continue;
}
}
}
}
示例2: ImportDeparture
private void ImportDeparture(TrafficLine ActuallTrafficLine, JProperty Start)
{
foreach (JProperty DepArrProp in Start.Values())
{
if (DepArrProp.Name == "departure")
{
foreach (JObject TimeObject in DepArrProp.Values().ToList())
{
foreach (JProperty TimeProp in TimeObject.Properties())
{
if (TimeProp.Name == "departureTime")
{
Departure ActuallDeparture = new Departure();
ActuallDeparture.Parent = ActuallTrafficLine;
ActuallDeparture.DeArType = DepartureArrivelType.departureTime;
ActuallTrafficLine.Departures.Add(ActuallDeparture);
foreach (JProperty TimeTimeProject in TimeProp.Value.ToList())
{
if (TimeTimeProject.Name == "timePlanned")
{
ActuallDeparture.TimePlanned = TimeTimeProject.Value.ToObject<DateTime>();
}
if (TimeTimeProject.Name == "timeReal")
{
ActuallDeparture.TimeReal = TimeTimeProject.Value.ToObject<DateTime>();
}
if (TimeTimeProject.Name == "countdown")
{
ActuallDeparture.CountDown = TimeTimeProject.Value.ToObject<Int32>();
}
}
}
if (TimeProp.Name == "vehicle")
{
}
}
}
}
}
}
示例3: ImportLocationStop
private LocationStop ImportLocationStop(WienerLinienDataModell NewDataModell, JProperty Start)
{
LocationStop ActuallLocationStop = new LocationStop();
ActuallLocationStop.Parent = NewDataModell;
NewDataModell.LocationStops.Add(ActuallLocationStop);
foreach (JProperty LocProp in Start.Values())
{
if (LocProp.Name == "type")
{
LocationType Output;
if (Enum.TryParse(LocProp.Value.ToString(), true, out Output))
ActuallLocationStop.LocType = Output;
else
ActuallLocationStop.LocType = LocationType.Error;
continue;
}
if (LocProp.Name == "geometry")
{
foreach (JProperty geoProp in LocProp.Values())
{
if (geoProp.Name == "type")
{
GeometryType Output;
if (Enum.TryParse(geoProp.Value.ToString(), true, out Output))
ActuallLocationStop.GeoType = Output;
else
ActuallLocationStop.GeoType = GeometryType.Error;
continue;
}
if (geoProp.Name == "coordinates")
{
ActuallLocationStop.GeoLon = geoProp.Value.ToArray()[0].ToObject<double>();
ActuallLocationStop.GeoLat = geoProp.Value.ToArray()[1].ToObject<double>();
}
}
}
if (LocProp.Name == "properties")
{
foreach (JProperty propProp in LocProp.Values())
{
if (propProp.Name == "name")
{
ActuallLocationStop.Name = propProp.Value.ToString();
continue;
}
if (propProp.Name == "title")
{
ActuallLocationStop.Title = propProp.Value.ToString();
continue;
}
if (propProp.Name == "municipality")
{
ActuallLocationStop.Ort = propProp.Value.ToString();
continue;
}
if (propProp.Name == "municipalityId")
{
ActuallLocationStop.OrtID = propProp.Value.ToObject<Int32>();
continue;
}
if (propProp.Name == "type")
{
StopType Output;
if (Enum.TryParse(propProp.Value.ToString(), true, out Output))
ActuallLocationStop.StopType = Output;
else
ActuallLocationStop.StopType = StopType.Error;
continue;
}
if (propProp.Name == "coordName")
{
CoordType Output;
if (Enum.TryParse(propProp.Value.ToString(), true, out Output))
ActuallLocationStop.CoType = Output;
else
ActuallLocationStop.CoType = CoordType.Error;
continue;
}
if (propProp.Name == "gate")
{
ActuallLocationStop.Gate = propProp.Value.ToString();
continue;
}
if (propProp.Name == "attributes")
{
foreach (JProperty attrPropProp in propProp.Values())
{
ActuallLocationStop.Attributes[attrPropProp.Name] =
attrPropProp.Value.ToString();
}
continue;
}
}
}
}
return ActuallLocationStop;
}