Ejemplo n.º 1
0
        public void WriteElement(ref BssomWriter writer, BssomSerializerOptions option, BssomFieldOffsetInfo offsetInfo, Object value)
        {
            if (value is null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            IArray1ElementWriter array1ElementWriter = Array1ElementWriterContainers.GetArray1ElementWriter(offsetInfo.Array1ElementTypeIsNativeType, offsetInfo.Array1ElementType);

            array1ElementWriter.WriteObjectElement(ref writer, option, offsetInfo, value);
        }
Ejemplo n.º 2
0
        static Array1ElementWriterFactory()
        {
            Type t = typeof(T);

            if (t == typeof(object) || t == typeof(BssomValue) || t == typeof(BssomChar) || t == typeof(BssomBoolean) || t == typeof(BssomDateTime) || t == typeof(BssomDecimal) || t == typeof(BssomFloat) || t == typeof(BssomGuid) || t == typeof(BssomNumber))
            {
                _controller = (IArray1ElementWriter <T>)(object) ObjectArray1ElementWriter.Instance;
            }
            else
            {
                _controller = (IArray1ElementWriter <T>)Array1ElementWriterContainers.GetArray1ElementWriter(t);
            }
        }
Ejemplo n.º 3
0
        public Object ReadElement(ref BssomReader reader, BssomSerializerOptions option, BssomFieldOffsetInfo offsetInfo)
        {
            IArray1ElementWriter array1ElementWriter = Array1ElementWriterContainers.GetArray1ElementWriter(offsetInfo.Array1ElementTypeIsNativeType, offsetInfo.Array1ElementType);

            return(array1ElementWriter.ReadObjectElement(ref reader, option, offsetInfo));
        }