Example #1
0
        public void WriteMembers(object instance, ISerialiserNode parentNode, Type type)
        {
            var typeName = typeNamesCache.GetTypeName(type);

            using (
                var baseClassNode = ownerDocument.CreateBaseClassElement(typeName, parentNode))
            {
                using (var membersNode = ownerDocument.CreateMembersElement(baseClassNode))
                {
                    memberWriter.Write(instance, membersNode, type);
                }
                baseTypeMembersWriter.WriteMembers(instance, baseClassNode, type);
            }
        }
Example #2
0
        public void Write(object instance, INodeWriter parentNode, Type referencedAsType)
        {
            var objectID = valuesCache.Add(instance);
            var typeName = typeNamesCache.GetTypeName(instance.GetType());

            using (var classNode = ownerDocument.CreateClassElement(typeName, objectID, parentNode))
            {
                using (var membersNode = ownerDocument.CreateMembersElement(classNode))
                {
                    memberWriter.Write(instance, membersNode, instance.GetType());
                }

                baseTypeMembersWriter.WriteMembers(instance, classNode, instance.GetType());
            }
        }
 public void WriteMembers(object instance, ISerialiserNode parentNode, Type type)
 {
     baseTypeMemberWriter.WriteMembers(instance, parentNode, type);
 }