本文整理汇总了C#中ConversionVisitor.ConvertXmlDoc方法的典型用法代码示例。如果您正苦于以下问题:C# ConversionVisitor.ConvertXmlDoc方法的具体用法?C# ConversionVisitor.ConvertXmlDoc怎么用?C# ConversionVisitor.ConvertXmlDoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConversionVisitor
的用法示例。
在下文中一共展示了ConversionVisitor.ConvertXmlDoc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseSnippet
/*
/// <summary>
/// Parses a file snippet; guessing what the code snippet represents (whole file, type members, block, type reference, expression).
/// </summary>
public AstNode ParseSnippet (string code)
{
// TODO: add support for parsing a part of a file
throw new NotImplementedException ();
}
*/
public DocumentationReference ParseDocumentationReference(string cref)
{
// see Mono.CSharp.DocumentationBuilder.HandleXrefCommon
if (cref == null)
throw new ArgumentNullException("cref");
// Additional symbols for < and > are allowed for easier XML typing
cref = cref.Replace('{', '<').Replace('}', '>');
lock (parseLock) {
errorReportPrinter = new ErrorReportPrinter("");
var ctx = new CompilerContext(compilerSettings.ToMono(), errorReportPrinter);
ctx.Settings.TabSize = 1;
var reader = new SeekableStreamReader(new StringTextSource(cref));
var file = new SourceFile("", "", 0);
Location.Initialize(new List<SourceFile>(new [] { file }));
var module = new ModuleContainer(ctx);
module.DocumentationBuilder = new DocumentationBuilder(module);
var source_file = new CompilationSourceFile(module);
var report = new Report(ctx, errorReportPrinter);
var session = new ParserSession();
session.LocationsBag = new LocationsBag();
var parser = new Mono.CSharp.CSharpParser(reader, source_file, report, session);
parser.Lexer.Line += initialLocation.Line - 1;
parser.Lexer.Column += initialLocation.Column - 1;
parser.Lexer.putback_char = Tokenizer.DocumentationXref;
parser.Lexer.parsing_generic_declaration_doc = true;
parser.parse();
if (report.Errors > 0) {
// Report.Warning (1584, 1, mc.Location, "XML comment on `{0}' has syntactically incorrect cref attribute `{1}'",
// mc.GetSignatureForError (), cref);
}
var conversionVisitor = new ConversionVisitor(false, session.LocationsBag);
var docRef = conversionVisitor.ConvertXmlDoc(module.DocumentationBuilder);
CompilerCallableEntryPoint.Reset();
return docRef;
}
}