public void WriteValue(IValueWriter valueWriter, T value) { if (valueWriter is ITargetedBind targeted) { var interfaces = Interfaces; var id = targeted.Id; for (int i = 0; i < interfaces.Length; i++) { if (interfaces[i].Key == id) { interfaces[i].Value.WriteValue(valueWriter, value); return; } } } DefaultInterface.WriteValue(valueWriter, value); }
public static void WriteValue(T value, IValueWriter valueWriter) { Content.WriteValue(valueWriter, value); }
public override void OnReadValue(object obj, IValueWriter valueWriter) { valueInterface.WriteValue(valueWriter, ReadValue <T>(obj)); }
/// <summary> /// 非泛型写入值方法。 /// </summary> /// <param name="valueWriter">值写入器</param> /// <param name="value">T 类型的值</param> public override void WriteValue(IValueWriter valueWriter, object value) { Content.WriteValue(valueWriter, (T)value); }