private void saveCustomPropertyValue(XmlObjectWriter writer, PropertyClassDescriptor p, XmlNode rootNode) { XmlNode node = getClassRefNode(rootNode); XmlNode nodeProp = getPropertyNode(node, p.Name); if (p.CustomProperty.PropertyType.IsLibType) { DesignerSerializationVisibilityAttribute visibility = (DesignerSerializationVisibilityAttribute)p.Attributes[typeof(DesignerSerializationVisibilityAttribute)]; writer.WriteProperty(p, nodeProp, this, visibility.Visibility, XmlTags.XML_PROPERTY); } }
public void SaveCustomPropertyValue(XmlObjectWriter writer, string name, XmlNode rootNode) { PropertyClassDescriptor p = null; if (_properties == null) { throw new DesignerException("Saving property {0} for class [{1},{2}]: custom properties not loaded", name, ClassId, MemberId); } foreach (PropertyClassDescriptor pr in _properties) { if (pr.Name == name) { p = pr; break; } } if (p == null) { throw new DesignerException("Saving property {0} for class [{1},{2}]: custom property not found", name, ClassId, MemberId); } saveCustomPropertyValue(writer, p, rootNode); }