protected virtual XElement SerializeWithPropertyParser(IXmlObjectModelPropertyParser propertyParser, object obj) { var element = new XElement("obj"); var mirrorObjectModel = new MirrorObjectModel(obj); var properties = mirrorObjectModel.GetProperties(); foreach (var property in properties) { propertyParser.DefineProperty(element, property.Name, property.Type, property.Value, property.ReadOnly); } return element; }
public override void Export(IXmlObject obj, XElement target) { var mirror = new MirrorObjectModel(obj); //var properties = target.GetProperties(); var properties = mirror.GetProperties(); foreach (var property in properties) { if (property == null) continue; GetOrUpdateProperty(target, property); } }