Exemplo n.º 1
0
        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()));
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 public void Reset()
 {
     this.currentAttribute = XmlAttributeEnumerator.sentinelNode;
 }
Exemplo n.º 5
0
 public XmlAttributeEnumerator(XmlElement element, Predicate <XmlAttribute> predicate)
 {
     this.element          = element;
     this.predicate        = predicate;
     this.currentAttribute = XmlAttributeEnumerator.sentinelNode;
 }