Пример #1
0
        public void Write(object instance, INodeWriter parentNode, Type referencedAsType)
        {
            var typeName = typeNamesCache.GetTypeName(instance.GetType());

            using (
                var node = ownerDocument.CreateValueElement(typeName, parentNode))
            {
                using (var membersNode = ownerDocument.CreateMembersElement(node))
                {
                    memberWriter.Write(instance, membersNode, instance.GetType());
                }
            }
        }