当前位置: 首页>>代码示例>>C#>>正文


C# Text.SetLineInfo方法代码示例

本文整理汇总了C#中Text.SetLineInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Text.SetLineInfo方法的具体用法?C# Text.SetLineInfo怎么用?C# Text.SetLineInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Text的用法示例。


在下文中一共展示了Text.SetLineInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadContent

        /// <summary>
        /// Reads all supported documentation elements.
        /// </summary>
        private static IEnumerable<Element> ReadContent(XElement xml)
        {
            foreach (var node in xml.Nodes())
            {
                var element = default(Element);
                switch (node.NodeType)
                {
                    case System.Xml.XmlNodeType.Element:
                        var elementNode = (XElement)node;
                        switch (elementNode.Name.LocalName)
                        {
                            case "summary":
                                element = new Summary(ReadContent(elementNode));
                                break;
                            case "remarks":
                                element = new Remarks(ReadContent(elementNode));
                                break;
                            case "example":
                                element = new Example(ReadContent(elementNode));
                                break;
                            case "para":
                                element = new Para(ReadContent(elementNode));
                                break;
                            case "param":
                                element = new Param(FindAttribute(elementNode, "name"), ReadContent(elementNode));
                                break;
                            case "paramref":
                                element = new ParamRef(FindAttribute(elementNode, "name"));
                                break;
                            case "typeparam":
                                element = new TypeParam(FindAttribute(elementNode, "name"), ReadContent(elementNode));
                                break;
                            case "typeparamref":
                                element = new TypeParamRef(FindAttribute(elementNode, "name"));
                                break;
                            case "code":
                                element = new Code(TrimCode(elementNode.Value));
                                break;
                            case "c":
                                element = new C(elementNode.Value);
                                break;
                            case "see":
                                element = new See(FindAttribute(elementNode, "cref"), FindAttribute(elementNode, "langword"), elementNode.Value, ReadContent(elementNode));
                                break;
                            case "seealso":
                                element = new SeeAlso(FindAttribute(elementNode, "cref"), elementNode.Value, ReadContent(elementNode));
                                break;
                            case "list":
                                element = new List(FindAttribute(elementNode, "type"), ReadContent(elementNode));
                                break;
                            case "listheader":
                                element = new ListHeader(ReadContent(elementNode));
                                break;
                            case "term":
                                element = new Term(ReadContent(elementNode));
                                break;
                            case "description":
                                element = new Description(ReadContent(elementNode));
                                break;
                            case "item":
                                element = new Item(ReadContent(elementNode));
                                break;
                            case "exception":
                                element = new Exception(FindAttribute(elementNode, "cref"), ReadContent(elementNode));
                                break;
                            case "value":
                                element = new Value(ReadContent(elementNode));
                                break;
                            case "returns":
                                element = new Returns(ReadContent(elementNode));
                                break;
                            default:
                                element = new UnknownElement(elementNode, ReadContent(elementNode));
                                break;
                        }
                        break;
                    case System.Xml.XmlNodeType.Text:
                        element = new Text(TrimText(((XText)node).Value));
                        break;
                    default:
                        break;
                }

                if (element != null)
                {
                    element.SetLineInfo(xml as IXmlLineInfo);
                    yield return element;
                }
            }
        }
开发者ID:yannduran,项目名称:NuDoq,代码行数:93,代码来源:DocReader.cs


注:本文中的Text.SetLineInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。