コード例 #1
0
ファイル: XmlObjectModelTests.cs プロジェクト: LazyTarget/Lux
 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;
 }
コード例 #2
0
        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);
            }
        }