Пример #1
0
 void importSimpleProperties(XElement element, XPBaseObject xpBaseObject) {
     IEnumerable<XElement> simpleElements =
         element.Descendants("Property").Where(
             xElement => xElement.GetAttributeValue("type") == NodeType.Simple.ToString().MakeFirstCharLower());
     foreach (var simpleElement in simpleElements) {
         string propertyName = simpleElement.GetAttributeValue("name");
         XPMemberInfo xpMemberInfo = xpBaseObject.ClassInfo.GetMember(propertyName);
         object value = GetValue(simpleElement, xpMemberInfo);
         if (simpleElement.GetAttributeValue("isNaturalKey")=="true"&&!xpBaseObject.IsNewObject())
             continue;
         xpBaseObject.SetMemberValue(propertyName, value);
     }
 }