当前位置: 首页>>代码示例>>C#>>正文


C# JsonWriter.WriteProperty方法代码示例

本文整理汇总了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);
 }
开发者ID:sethjuarez,项目名称:numl,代码行数:10,代码来源:StringPropertySerializer.cs

示例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);
     }
 }
开发者ID:sethjuarez,项目名称:numl,代码行数:17,代码来源:ModelSerializer.cs

示例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);
     }
 }
开发者ID:sethjuarez,项目名称:numl,代码行数:18,代码来源:SummarySerializer.cs

示例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);
            }
        }
开发者ID:sethjuarez,项目名称:numl,代码行数:22,代码来源:NeuralNetworkModelSerializer.cs

示例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);
     }
 }
开发者ID:sethjuarez,项目名称:numl,代码行数:10,代码来源:LinearRegressionSerializer.cs

示例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);
     }
 }
开发者ID:sethjuarez,项目名称:numl,代码行数:11,代码来源:TreeSerializer.cs

示例7: Write

 public override void Write(JsonWriter writer, object value)
 {
     base.Write(writer, value);
     var p = (EnumerableProperty)value;
     writer.WriteProperty("Length", p.Length);
 }
开发者ID:sethjuarez,项目名称:numl,代码行数:6,代码来源:EnumerablePropertySerializer.cs


注:本文中的JsonWriter.WriteProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。