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);
                }
            }
        }
Exemplo n.º 2
0
        private void DrawHtmlAttributes(XmlWriter writer, int paneNo)
        {
            if (this._attributes == null)
            {
                return;
            }
            var data = string.Empty;

            if (this._attributes._nextSibbling != null)
            {
                data = XmlDiffView.GetIndent(this._name.Length + 2);
            }
            var attr = this._attributes;

            while (attr != null)
            {
                if (XmlDiffView.HtmlWriteToPane[(int)attr._op, paneNo])
                {
                    if (attr == this._attributes)
                    {
                        writer.WriteString(" ");
                    }
                    else
                    {
                        writer.WriteRaw(data);
                    }
                    if (attr._op == XmlDiffViewOperation.Change)
                    {
                        if (paneNo == 0)
                        {
                            this.DrawHtmlAttributeChange(writer, attr, attr._localName, attr._prefix, attr._value);
                        }
                        else
                        {
                            this.DrawHtmlAttributeChange(writer, attr, attr._changeInfo._localName, attr._changeInfo._prefix, attr._changeInfo._value);
                        }
                    }
                    else
                    {
                        this.DrawHtmlAttribute(writer, attr, attr._op);
                    }
                }
                else
                {
                    XmlDiffView.HtmlWriteEmptyString(writer);
                }
                attr = (XmlDiffViewAttribute)attr._nextSibbling;
                if (attr != null)
                {
                    XmlDiffView.HtmlBr(writer);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Generates attributes' output data in html form
        /// </summary>
        /// <param name="writer">output stream</param>
        /// <param name="paneNo">Pane number, indicating
        ///  the left (baseline) or right side (actual) of the
        ///  display</param>
        private void DrawHtmlAttributes(
            XmlWriter writer,
            int paneNo)
        {
            if (this.Attributes == null)
            {
                return;
            }
            string attrIndent = string.Empty;

            if (this.Attributes.NextSibbling != null)
            {
                attrIndent = XmlDiffView.GetIndent(this.Name.Length + 2);
            }
            XmlDiffViewAttribute curAttr = this.Attributes;

            while (curAttr != null)
            {
                if (XmlDiffView.HtmlWriteToPane[(int)curAttr.Operation, paneNo])
                {
                    if (curAttr == this.Attributes)
                    {
                        writer.WriteString(" ");
                    }
                    else
                    {
                        writer.WriteRaw(attrIndent);
                    }
                    if (curAttr.Operation == XmlDiffViewOperation.Change)
                    {
                        if (paneNo == 0)
                        {
                            this.DrawHtmlAttributeChange(
                                writer,
                                curAttr,
                                curAttr.LocalName,
                                curAttr.Prefix,
                                curAttr.AttributeValue);
                        }
                        else
                        {
                            this.DrawHtmlAttributeChange(
                                writer,
                                curAttr,
                                curAttr.ChangeInformation.LocalName,
                                curAttr.ChangeInformation.Prefix,
                                curAttr.ChangeInformation.Subset);
                        }
                    }
                    else
                    {
                        this.DrawHtmlAttribute(
                            writer,
                            curAttr,
                            curAttr.Operation);
                    }
                }
                else
                {
                    XmlDiffView.HtmlWriteEmptyString(writer);
                }
                curAttr = (XmlDiffViewAttribute)curAttr.NextSibbling;
                if (curAttr != null)
                {
                    XmlDiffView.HtmlBr(writer);
                }
            }
        }