예제 #1
0
        public void WriteValue(IValueWriter valueWriter, T value)
        {
            if (value == null)
            {
                valueWriter.DirectWrite(null);

                return;
            }

            var dictionaryRW = new DictionaryRW <T, TKey, TValue>();

            dictionaryRW.Initialize(value);

            if (typeof(TKey) == typeof(string))
            {
                valueWriter.WriteObject(Unsafe.As <IDataReader <string> >(dictionaryRW));
            }
            else
            {
                if (valueWriter is IMapValueWriter mapWriter)
                {
                    mapWriter.WriteMap(dictionaryRW);
                }
                else
                {
                    valueWriter.WriteObject(dictionaryRW.As <string>());
                }
            }
        }
예제 #2
0
        public void WriteValue(IValueWriter valueWriter, T value)
        {
            if (value == null)
            {
                valueWriter.DirectWrite(null);

                return;
            }

            var dictionaryRW = new DictionaryRW <T, TKey, TValue>();

            dictionaryRW.Initialize(value);

            valueWriter.WriteObject(((IDataReader)dictionaryRW).As <string>());
        }
예제 #3
0
        public void WriteValue(IValueWriter valueWriter, T value)
        {
            if (value == null)
            {
                valueWriter.DirectWrite(null);

                return;
            }

            var dictionaryRW = new DictionaryRW <T>();

            dictionaryRW.Initialize(value);

            if (valueWriter is IMapValueWriter mapWriter)
            {
                mapWriter.WriteMap(dictionaryRW);
            }
            else
            {
                valueWriter.WriteObject(dictionaryRW.As <string>());
            }
        }
예제 #4
0
        public void WriteValue(IValueWriter valueWriter, T value)
        {
            if (value == null)
            {
                valueWriter.DirectWrite(null);

                return;
            }

            var dictionaryRW = new DictionaryRW <T, TKey, TValue>();

            dictionaryRW.Initialize(value);

            if (IsArray)
            {
                valueWriter.WriteArray(dictionaryRW.As <int>());
            }
            else
            {
                valueWriter.WriteObject(dictionaryRW.As <string>());
            }
        }