You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The class definition is not used when serializing. Instead it creates a blank
class definition and serializes the members as dynamic. A simple fix is to add
a class definition field to ASObject and set/use it when dealing with an
anonymous type.
internal object ReadAMF3Object(ClassDefinition classDefinition)
{
object instance = null;
if (!string.IsNullOrEmpty(classDefinition.ClassName))
instance = ObjectFactory.CreateInstance(classDefinition.ClassName);
else
instance = new ASObject() { ClassDefinition = classDefinition }; //This is an anonymous type. Store the class definition for when serializing.
private ClassDefinition GetClassDefinition(object obj)
{
ClassDefinition classDefinition = null;
if (obj is ASObject)
{
ASObject asObject = obj as ASObject;
if (asObject.ClassDefinition != null) //Definition was set, that means this is an anonymous type. Return the ClassDefinition property.
return asObject.ClassDefinition;
Original issue reported on code.google.com by High...@gmail.com on 10 Dec 2011 at 4:19
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
High...@gmail.com
on 10 Dec 2011 at 4:19The text was updated successfully, but these errors were encountered: