ExternalizedPropertyDescriptor EnsureXmlSerializable(ExternalizedPropertyDescriptor descriptor) { if (descriptor == null) { return(null); } var xmlIgnore = descriptor.Attributes[typeof(XmlIgnoreAttribute)]; if (xmlIgnore != null) { var converted = true; var serializableDescriptor = descriptor.Convert(externalizedProperty => { var proxyDescriptor = (from property in TypeDescriptor.GetProperties(externalizedProperty.ComponentType).Cast <PropertyDescriptor>() let xmlElement = (XmlElementAttribute)property.Attributes[typeof(XmlElementAttribute)] where xmlElement != null && xmlElement.ElementName == externalizedProperty.Name select property) .FirstOrDefault(); converted &= proxyDescriptor != null; return(proxyDescriptor); }); return(converted ? serializableDescriptor : null); } return(descriptor); }
private ExternalizedPropertyDescriptor(ExternalizedPropertyDescriptor descr, PropertyDescriptor[] descriptors) : base(descr.Name, null) { instances = descr.instances; properties = descriptors; description = descr.description; category = descr.category; isReadOnly = descr.isReadOnly; }
public ExternalizedAttributeCollection(ExternalizedPropertyDescriptor owner) : base(null) { this.owner = owner; }