Beispiel #1
0
 void ProcessNestedAttributes(string nestedName, PropertyVisitor parentProperty)
 {
     foreach (var propertyInfo in GetProperties(parentProperty.PropertyInfo.PropertyType, 0))
     {
         var attributes = propertyInfo.GetCustomAttributes(typeof(XmlAttributeAttribute), false);
         if (attributes.Length != 0)
         {
             var attribute_attribute = (XmlAttributeAttribute)attributes[0];
             var name = string.IsNullOrEmpty(attribute_attribute.Name)
                 ? propertyInfo.Name
                 : attribute_attribute.Name;
             var id = PropertyName.CreateForAttribute(name, attribute_attribute.Prefix, nestedName);
             properties[id] = new NestedValuePropertyVisitor(
                 parentProperty, attribute_attribute.OmitIfNull, propertyInfo);
         }
     }
 }
 void ProcessNestedAttributes (string nestedName, PropertyVisitor parentProperty)
 {
     foreach (var propertyInfo in GetProperties (parentProperty.PropertyInfo.PropertyType, 0)) {
         var attributes = propertyInfo.GetCustomAttributes (typeof (XmlAttributeAttribute), false);
         if (attributes.Length != 0) {
             var attribute_attribute = (XmlAttributeAttribute)attributes[0];
             var name = string.IsNullOrEmpty (attribute_attribute.Name)
                 ? propertyInfo.Name
                 : attribute_attribute.Name;
             var id = PropertyName.CreateForAttribute (name, attribute_attribute.Prefix, nestedName);
             properties[id] = new NestedValuePropertyVisitor (
                 parentProperty, attribute_attribute.OmitIfNull, propertyInfo);
         }
     }
 }