protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, object value)
        {
            if (serializer.AlreadyScanned(value))
            {
                return;
            }

            // First scan the base type.
            if (_baseSerializer != null)
            {
                _baseSerializer.ScanChildren(serializer, callback, value);
            }

            // Now scan our own elements.
            foreach (var info in _elements)
            {
                var elementValue = info.Getter(value);

                callback(info.Serializer, elementValue);

                var elementSerializer = info.Serializer;
                if (elementValue != null)
                {
                    elementSerializer = serializer.GetTypeSerializer(elementValue.GetType());
                }

                elementSerializer.ScanChildren(serializer, callback, elementValue);
            }
        }
 protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, NamedValueDictionary <T> value)
 {
     foreach (var kvp in value)
     {
         callback(serializer.GetTypeSerializer(typeof(T)), kvp.Value);
     }
 }
 protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, List <T> value)
 {
     foreach (var item in value)
     {
         callback(_itemSerializer, item);
     }
 }
 protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, object value)
 {
     throw new NotImplementedException();
 }
Exemple #5
0
 protected internal virtual void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, T value)
 {
     base.ScanChildren(serializer, callback, value);
 }
Exemple #6
0
 protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, Dictionary <TKey, TValue> value)
 {
     foreach (var kvp in value)
     {
         callback(_keySerializer, kvp.Key);
         callback(_valueSerializer, kvp.Value);
     }
 }
 protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, object value)
 {
     if (value == null)
     {
         return;
     }
     ScanChildren(serializer, callback, (T)value);
 }
Exemple #8
0
 protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, Object value)
 {
     ScanChildren(serializer, callback, (T)value);
 }
        protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, object value)
        {
            var cast = value == null ? default(T) : (T)value;

            ScanChildren(serializer, callback, cast);
        }
 protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, T[] value)
 {
     _listSerializer.ScanChildren(serializer, callback, new List <T>(value));
 }
 protected internal virtual void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, object value)
 {
 }
		protected internal override void ScanChildren (IntermediateSerializer serializer, ChildCallback callback, object value)
		{
			base.ScanChildren (serializer, callback, value);
		}
 protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, object value)
 {
     throw new NotImplementedException();
 }
        protected internal override void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, object value)
        {
            if (serializer.AlreadyScanned(value))
                return;

            // First scan the base type.
            if (_baseSerializer != null)
                _baseSerializer.ScanChildren(serializer, callback, value);

            // Now scan our own elements.
            foreach (var info in _elements)
            {
                var elementValue = info.Getter(value);

                callback(info.Serializer, elementValue);

                var elementSerializer = info.Serializer;
                if (elementValue != null)
                    elementSerializer = serializer.GetTypeSerializer(elementValue.GetType());

                elementSerializer.ScanChildren(serializer, callback, elementValue);
            }
        }
 protected internal virtual void ScanChildren(IntermediateSerializer serializer, ChildCallback callback, object value)
 {
 }