Exemplo n.º 1
0
        /// <summary>
        /// 执行builder,反射用到的
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="setting">The setting.</param>
        /// <param name="level"></param>
        /// <param name="source">The source.</param>
        internal static void CallNullablePrimitiveBuilderInvoke <T>(ISerializerWriter writer, JsonSerializeSetting setting, Nullable <T> source, byte level) where T : struct
        {
            if (!source.HasValue)
            {
                writer.Write("null");
                return;
            }

            ZzzZzSerialierBuilder <T> .Register(setting).Invoke(writer, setting, source.Value, level);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 执行builder,反射用到的
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="writer">The writer.</param>
        /// <param name="setting">The setting.</param>
        /// <param name="level"></param>
        /// <param name="source">The source.</param>
        internal static void CallBuilderInvoke <T>(ISerializerWriter writer, JsonSerializeSetting setting, T source, byte level)
        {
            var @delegate = ZzzZzSerialierBuilder <T> .Register(setting);

            @delegate(writer, setting, source, level++);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 执行构建序列化,反射用到的
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="writer"></param>
 /// <param name="setting"></param>
 /// <param name="level"></param>
 /// <param name="object"></param>
 /// <returns></returns>
 private static void BuilderInvoke <T>(ISerializerWriter writer, JsonSerializeSetting setting, object @object, byte level)
 {
     ZzzZzSerialierBuilder <T> .Register(setting).Invoke(writer, setting, (T)@object, level);
 }