9using System.Collections.Generic;
15using System.Reflection;
43 public MobileList(IEnumerable<T> collection) : base(collection) { }
45 #region IMobileObject Members
66 private const string _valuePrefix =
"v";
76 bool mobileChildren = typeof(
IMobileObject).IsAssignableFrom(typeof(T));
78 foreach (T child
in this)
87 info.
AddValue(_valuePrefix + count, child);
119 bool mobileChildren = typeof(
IMobileObject).IsAssignableFrom(typeof(T));
120 int count = info.GetValue<
int>(
"count");
122 for (
int index = 0; index < count; index++)
128 value = info.GetValue<T>(_valuePrefix + index);
System.Runtime.Serialization serialization
Implements a list that is serializable using the SerializationFormatterFactory.GetFormatter().
virtual void OnGetChildren(SerializationInfo info, MobileFormatter formatter)
Override this method to manually serialize child objects contained within the current object.
MobileList(IEnumerable< T > collection)
Creates an instance of the type.
MobileList(int capacity)
Creates an instance of the type.
virtual void OnSetState(SerializationInfo info)
Override this method to retrieve extra field values to the serialization stream.
MobileList()
Creates an instance of the type.
virtual void OnSetChildren(SerializationInfo info, MobileFormatter formatter)
Override this method to manually deserialize child objects from data in the serialization stream.
virtual void OnGetState(SerializationInfo info)
Override this method to add extra field values to the serialization stream.
Object containing the serialization data for a specific object.
int ReferenceId
Reference number for this object.
Dictionary< string, ChildData > Children
Dictionary containing child reference data.
void AddChild(string name, int referenceId)
Adds a child to the list of child references.
void AddValue(string name, object value)
Adds a value to the serialization stream.
Interface to be implemented by any object that supports serialization by the SerializationFormatterFa...
void GetChildren(SerializationInfo info, MobileFormatter formatter)
Method called by MobileFormatter when an object should serialize its child references.
void GetState(SerializationInfo info)
Method called by MobileFormatter when an object should serialize its data.
void SetChildren(SerializationInfo info, MobileFormatter formatter)
Method called by MobileFormatter when an object should deserialize its child references.
void SetState(SerializationInfo info)
Method called by MobileFormatter when an object should be deserialized.