Exemplo n.º 1
0
        private JetBrains.UI.RichText.RichText ProcessCRef(string value)
        {
            DeclaredElementPresenterStyle presenterStyle = XmlDocPresenterUtil.LinkedElementPresentationStyle;

            if (this.myTextStyles != null)
            {
                presenterStyle            = presenterStyle.Clone();
                presenterStyle.TextStyles = this.myTextStyles;
            }
            return(XmlDocRichTextPresenterEx.ProcessCRef(value, this.myLanguageType, this.myModule, presenterStyle));
        }
Exemplo n.º 2
0
 public override void VisitCData(XmlCDataSection cdataSection)
 {
     this.Append(XmlDocRichTextPresenterEx.RemoveExtraSpaces(cdataSection.InnerText), XmlDocRichTextPresenterEx.ourNormalStyle);
     base.VisitCData(cdataSection);
 }
Exemplo n.º 3
0
        public override void VisitList(XmlElement element)
        {
            XmlDocListType xmlDocListType = XmlDocListType.TABLE;
            XmlAttribute   attribute      = element.Attributes["type"];

            if (attribute != null)
            {
                if (attribute.Value == "bullet")
                {
                    xmlDocListType = XmlDocListType.BULLET;
                }
                if (attribute.Value == "number")
                {
                    xmlDocListType = XmlDocListType.NUMBER;
                }
            }
            XmlNode     node1       = element.SelectSingleNode("listheader");
            XmlNodeList xmlNodeList = element.SelectNodes("item");
            int         val1        = XmlDocRichTextPresenterEx.GetListItemTermSize(node1);

            foreach (XmlNode node2 in xmlNodeList)
            {
                val1 = Math.Max(val1, XmlDocRichTextPresenterEx.GetListItemTermSize(node2));
            }
            int num1 = 0;

            switch (xmlDocListType)
            {
            case XmlDocListType.BULLET:
                num1 = 1;
                break;

            case XmlDocListType.NUMBER:
                num1 = (int)Math.Floor(Math.Log10((double)xmlNodeList.Count)) + 1;
                break;
            }
            this.Append("\n");
            if (node1 != null)
            {
                if (num1 > 0)
                {
                    this.Append(new string(' ', num1 + 1));
                }
                XmlNode xmlNode = node1.SelectSingleNode("term");
                string  str     = xmlNode == null ? "" : xmlNode.InnerText.Trim();
                this.Append(str, XmlDocRichTextPresenterEx.ourNormalStyle);
                this.Append(new string(' ', val1 - str.Length + 1), XmlDocRichTextPresenterEx.ourNormalStyle);
                XmlNode node3 = node1.SelectSingleNode("description");
                if (node3 != null)
                {
                    this.VisitNode(node3);
                }
                this.Append("\n");
            }
            int num2 = 1;

            foreach (XmlNode xmlNode1 in xmlNodeList)
            {
                switch (xmlDocListType)
                {
                case XmlDocListType.BULLET:
                    this.Append("- ");
                    break;

                case XmlDocListType.NUMBER:
                    string str1 = num2.ToString((IFormatProvider)CultureInfo.InvariantCulture);
                    this.Append(str1, XmlDocRichTextPresenterEx.ourNormalStyle);
                    this.Append(new string(' ', num1 - str1.Length + 1), XmlDocRichTextPresenterEx.ourNormalStyle);
                    break;
                }
                ++num2;
                XmlNode xmlNode2 = xmlNode1.SelectSingleNode("term");
                if (xmlNode2 == null)
                {
                    this.Append(new string(' ', val1 + 1), XmlDocRichTextPresenterEx.ourNormalStyle);
                }
                else
                {
                    string str2 = xmlNode2.InnerText.Trim();
                    this.Append(str2, XmlDocRichTextPresenterEx.ourNormalStyle);
                    this.Append(new string(' ', val1 - str2.Length + 1), XmlDocRichTextPresenterEx.ourNormalStyle);
                }
                XmlNode node4 = xmlNode1.SelectSingleNode("description");
                if (node4 != null)
                {
                    this.VisitNode(node4);
                }
                this.Append("\n");
            }
        }
Exemplo n.º 4
0
 public override void VisitText(XmlText text)
 {
     this.Append(XmlDocRichTextPresenterEx.RemoveExtraSpaces(text.InnerText), XmlDocRichTextPresenterEx.ourNormalStyle);
     base.VisitText(text);
 }