public static string GetAttributeValue(XmlAttribute attribute) { if (attribute.FirstChild == null) { return(string.Empty); } if (attribute.FirstChild != null && attribute.FirstChild.NextNode == null) { Literal literal = attribute.FirstChild as Literal; if (literal != null) { return(XmlUtilities.GetLiteralValue(literal)); } } StringBuilder sb = new StringBuilder(); for (Microsoft.Expression.DesignModel.Markup.Xml.Node node = attribute.FirstChild; node != null; node = node.NextNode) { Literal literal; if ((literal = node as Literal) != null) { sb.Append(XmlUtilities.GetLiteralValue(literal)); } else { XmlEntityReference xmlEntityReference; if ((xmlEntityReference = node as XmlEntityReference) != null) { xmlEntityReference.GetLiteralValue(sb); } } } return(XmlUtilities.SubstituteOrRemoveCarriageReturnCharacters(sb.ToString())); }
public bool MoveNext() { for (this.currentAttribute = this.currentAttribute == XmlAttributeEnumerator.sentinelNode ? this.element.FirstAttribute : this.currentAttribute.NextNode; this.currentAttribute != null; this.currentAttribute = this.currentAttribute.NextNode) { if (this.predicate((XmlAttribute)this.currentAttribute)) { return(true); } } return(false); }
public ChildNode(XmlContainerReference.ChildType type, XmlContainerReference parent, Microsoft.Expression.DesignModel.Markup.Xml.Node node) { this.type = type; this.sourceContext = (XamlSourceContext) new UnprocessedNodeReference(parent, node.SourceContext); this.text = node.SourceContext.SourceText; }
public void Reset() { this.currentAttribute = XmlAttributeEnumerator.sentinelNode; }
public XmlAttributeEnumerator(XmlElement element, Predicate <XmlAttribute> predicate) { this.element = element; this.predicate = predicate; this.currentAttribute = XmlAttributeEnumerator.sentinelNode; }