Exemplo n.º 1
0
        private void DrawHtmlAttributes(XmlWriter writer, int paneNo)
        {
            if (_attributes == null)
            {
                return;
            }

            string attrIndent = string.Empty;

            if (_attributes._nextSibbling != null)
            {
                attrIndent = XmlDiffView.GetIndent(_name.Length + 2);
            }
            XmlDiffViewAttribute curAttr = _attributes;

            while (curAttr != null)
            {
                if (XmlDiffView.HtmlWriteToPane[(int)curAttr._op, paneNo])
                {
                    if (curAttr == _attributes)
                    {
                        writer.WriteString(" ");
                    }
                    else
                    {
                        writer.WriteRaw(attrIndent);
                    }

                    if (curAttr._op == XmlDiffViewOperation.Change)
                    {
                        if (paneNo == 0)
                        {
                            DrawHtmlAttributeChange(writer, curAttr, curAttr._localName, curAttr._prefix, curAttr._value);
                        }
                        else
                        {
                            DrawHtmlAttributeChange(writer, curAttr, curAttr._changeInfo._localName, curAttr._changeInfo._prefix,
                                                    curAttr._changeInfo._value);
                        }
                    }
                    else
                    {
                        DrawHtmlAttribute(writer, curAttr, curAttr._op);
                    }
                }
                else
                {
                    XmlDiffView.HtmlWriteEmptyString(writer);
                }

                curAttr = (XmlDiffViewAttribute)curAttr._nextSibbling;
                if (curAttr != null)
                {
                    XmlDiffView.HtmlBr(writer);
                }
            }
        }