本文整理汇总了C#中JsonWriter.WriteProperty方法的典型用法代码示例。如果您正苦于以下问题:C# JsonWriter.WriteProperty方法的具体用法?C# JsonWriter.WriteProperty怎么用?C# JsonWriter.WriteProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonWriter
的用法示例。
在下文中一共展示了JsonWriter.WriteProperty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public override void Write(JsonWriter writer, object value)
{
base.Write(writer, value);
var p = (StringProperty)value;
writer.WriteProperty("Separator", p.Separator);
writer.WriteProperty("SplitType", Enum.GetName(typeof(StringSplitType), p.SplitType));
writer.WriteArrayProperty("Dictionary", p.Dictionary);
writer.WriteArrayProperty("Exclude", p.Exclude);
writer.WriteProperty("AsEnum", p.AsEnum);
}
示例2: Write
/// <summary>
/// Serializes a generic model object to the stream.
/// </summary>
/// <param name="writer">A JSON Writer.</param>
/// <param name="value"></param>
public override void Write(JsonWriter writer, object value)
{
if (value == null) writer.WriteNull();
else
{
var model = (numl.Supervised.Model)value;
writer.WriteProperty(nameof(model.Descriptor), model.Descriptor);
writer.WriteProperty(nameof(model.NormalizeFeatures), model.NormalizeFeatures);
writer.WriteProperty(nameof(model.FeatureNormalizer), model.FeatureNormalizer?.GetType().FullName);
writer.WriteProperty(nameof(model.FeatureProperties), model.FeatureProperties);
}
}
示例3: Write
/// <summary>
/// Serializes the given Summary object to the given stream.
/// </summary>
/// <param name="writer">A JSON Writer object.</param>
/// <param name="value">A Summary object.</param>
public override void Write(JsonWriter writer, object value)
{
if (value == null) writer.WriteNull();
else
{
var summary = (Summary)value;
writer.WriteProperty(nameof(Summary.Average), summary.Average);
writer.WriteProperty(nameof(Summary.Minimum), summary.Minimum);
writer.WriteProperty(nameof(Summary.Median), summary.Median);
writer.WriteProperty(nameof(Summary.Maximum), summary.Maximum);
writer.WriteProperty(nameof(Summary.StandardDeviation), summary.StandardDeviation);
}
}
示例4: Write
/// <summary>
/// Serializes neural network model
/// </summary>
/// <param name="writer">JsonWriter</param>
/// <param name="value">Model to Serialize</param>
public override void Write(JsonWriter writer, object value)
{
if (value == null)
writer.WriteNull();
else
{
var model = (NeuralNetworkModel)value;
base.Write(writer, model);
// write out function
writer.WriteProperty(nameof(model.OutputFunction),
model.OutputFunction?.GetType().FullName);
// write out network
writer.WriteProperty(nameof(model.Network), model.Network);
}
}
示例5: Write
public override void Write(JsonWriter writer, object value)
{
if (value == null) writer.WriteNull();
else
{
var m = value as LinearRegressionModel;
base.Write(writer, m);
writer.WriteProperty(nameof(m.Theta), m.Theta);
}
}
示例6: Write
public override void Write(JsonWriter writer, object value)
{
if (value == null)
writer.WriteNull();
else
{
var t = value as Tree;
base.Write(writer, t);
writer.WriteProperty(nameof(t.Root), t.Root);
}
}
示例7: Write
public override void Write(JsonWriter writer, object value)
{
base.Write(writer, value);
var p = (EnumerableProperty)value;
writer.WriteProperty("Length", p.Length);
}