本文整理汇总了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;
}
}
}