/// <summary> /// Adds elements to the collection if it does not already exist. /// </summary> void AddElements(XmlCompletionDataCollection lhs, XmlCompletionDataCollection rhs) { foreach (XmlCompletionData data in rhs) { if (!lhs.Contains(data)) { lhs.Add(data); } } }
/// <summary> /// Adds an element completion data to the collection if it does not /// already exist. /// </summary> void AddElement(XmlCompletionDataCollection data, string name, string prefix, string documentation) { if (!data.Contains(name)) { if (prefix.Length > 0) { name = String.Concat(prefix, ":", name); } XmlCompletionData completionData = new XmlCompletionData(name, documentation); data.Add(completionData); } }
/// <summary> /// Adds an attribute value to the completion data collection. /// </summary> void AddAttributeValue(XmlCompletionDataCollection data, string valueText) { XmlCompletionData completionData = new XmlCompletionData(valueText, XmlCompletionData.DataType.XmlAttributeValue); data.Add(completionData); }
/// <summary> /// Adds an attribute value to the completion data collection. /// </summary> void AddAttributeValue(XmlCompletionDataCollection data, string valueText, XmlSchemaAnnotation annotation) { string documentation = GetDocumentation(annotation); XmlCompletionData completionData = new XmlCompletionData(valueText, documentation, XmlCompletionData.DataType.XmlAttributeValue); data.Add(completionData); }
/// <summary> /// Adds an attribute to the completion data collection. /// </summary> /// <remarks> /// Note the special handling of xml:lang attributes. /// </remarks> void AddAttribute(XmlCompletionDataCollection data, XmlSchemaAttribute attribute) { string name = attribute.Name; if (name == null) { if (attribute.RefName.Namespace == "http://www.w3.org/XML/1998/namespace") { name = String.Concat("xml:", attribute.RefName.Name); } } if (name != null) { string documentation = GetDocumentation(attribute.Annotation); XmlCompletionData completionData = new XmlCompletionData(name, documentation, XmlCompletionData.DataType.XmlAttribute); data.Add(completionData); } }