public override void OnWriteValue(int key, IValueReader valueReader) { if (typeof(TMode) == typeof(ArrayRWModes.Builder)) { if (index >= content.Length) { Extend(index * 2 + 1); } if (ValueInterface <TElement> .IsNotModified) { if (typeof(TElement) == typeof(string)) { Unsafe.As <string[]>(content)[index] = valueReader.ReadString(); } else if (typeof(TElement) == typeof(int)) { Unsafe.As <int[]>(content)[index] = valueReader.ReadInt32(); } else if (typeof(TElement) == typeof(bool)) { Unsafe.As <bool[]>(content)[index] = valueReader.ReadBoolean(); } else if (typeof(TElement) == typeof(double)) { Unsafe.As <double[]>(content)[index] = valueReader.ReadDouble(); } else if (typeof(TElement) == typeof(long)) { Unsafe.As <long[]>(content)[index] = valueReader.ReadInt64(); } else if (typeof(TElement) == typeof(DateTime)) { Unsafe.As <DateTime[]>(content)[index] = valueReader.ReadDateTime(); } else if (typeof(TElement) == typeof(decimal)) { Unsafe.As <decimal[]>(content)[index] = valueReader.ReadDecimal(); } else { content[index] = ValueInterface <TElement> .ReadValue(valueReader); } } else { content[index] = ValueInterface <TElement> .ReadValue(valueReader); } ++index; } else { content[key] = ValueInterface <TElement> .ReadValue(valueReader); } }
public bool ReadValue(IValueReader valueReader) { return(valueReader.ReadBoolean()); }