本文整理汇总了C#中JsonReader.ReadArrayProperty方法的典型用法代码示例。如果您正苦于以下问题:C# JsonReader.ReadArrayProperty方法的具体用法?C# JsonReader.ReadArrayProperty怎么用?C# JsonReader.ReadArrayProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonReader
的用法示例。
在下文中一共展示了JsonReader.ReadArrayProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
/// <summary>
/// Deserializes the object from the stream.
/// </summary>
/// <param name="reader">Stream to read from.</param>
/// <returns>Network object.</returns>
public override object Read(JsonReader reader)
{
if (reader.IsNull()) return null;
else
{
var network = (Network)this.Create();
var nodes = reader.ReadArrayProperty().Value.OfType<Neuron>();
var edges = reader.ReadArrayProperty().Value.OfType<Edge>();
network.LinkNodes(nodes, edges);
return network;
}
}
示例2: Read
public override object Read(JsonReader reader)
{
var p = (GuidProperty)base.Read(reader);
p.Categories = reader.ReadArrayProperty().Value
.Select(o => Guid.Parse((string)o))
.ToArray();
return p;
}
示例3: Read
public override object Read(JsonReader reader)
{
var p = (DateTimeProperty)base.Read(reader);
var features = reader.ReadArrayProperty().Value
.Select(o => (string)o)
.ToArray();
p.Features = DateTimeProperty.GetFeatures(features);
return p;
}
示例4: Read
public override object Read(JsonReader reader)
{
var p = (StringProperty)base.Read(reader);
p.Separator = reader.ReadProperty().Value.ToString();
p.SplitType = (StringSplitType)Enum.Parse(typeof(StringSplitType),
reader.ReadProperty().Value.ToString());
p.Dictionary = ((object[])reader.ReadArrayProperty().Value)
.Select(o => (string)o)
.ToArray();
p.Exclude = ((object[])reader.ReadProperty().Value)
.Select(o => (string)o)
.ToArray();
p.AsEnum = (bool)reader.ReadProperty().Value;
return p;
}