Esempio n. 1
0
        public static object[] GetValues(this IValueContainer container)
        {
            var values = new object[container.GetCount()];

            for (var i = 0; i < values.Length; i++)
            {
                values[i] = container.GetValue(i);
            }
            return(values);
        }
Esempio n. 2
0
        public static IValueContainer Clone(this IValueContainer container)
        {
            var copy       = new ValueContainer();
            var valueCount = container.GetCount();

            for (var i = 0; i < valueCount; i++)
            {
                copy.Add(container.GetName(i), container.GetType(i), container.GetValue(i));
            }
            return(copy);
        }
Esempio n. 3
0
        private void SerializeValueContainer(IValueContainer valueContainer, IValueWriter writer)
        {
            var valueCount = valueContainer.GetCount();

            for (var i = 0; i < valueCount; i++)
            {
                var name  = valueContainer.GetName(i);
                var type  = valueContainer.GetType(i);
                var value = valueContainer.GetValue(i);

                SerializeValue(name, type, value, writer);
            }
        }
Esempio n. 4
0
        public void Read(IObjectReconstructor reconstructor, ISerializer serializer)
        {
            var count = _container.GetCount();

            for (var i = 0; i < count; i++)
            {
                var valueInfo = new ValueInfo
                {
                    Name = _container.GetName(i),
                    Type = _container.GetType(i).ToTypeSerializationInfo(),
                };
                reconstructor.OnValueStart(valueInfo);
                reconstructor.OnValue(_container.GetValue(i));
                reconstructor.OnValueEnd();
            }
        }
Esempio n. 5
0
 public object GetValue(int index) => _impl.GetValue(index);
 public object GetValue(int index) => _valuesProxy.GetValue(index);
Esempio n. 7
0
 public object GetValue(int index) => _keysProxy.GetValue(index);