本文整理汇总了C#中MonoDevelop.GetCompilationAsync方法的典型用法代码示例。如果您正苦于以下问题:C# MonoDevelop.GetCompilationAsync方法的具体用法?C# MonoDevelop.GetCompilationAsync怎么用?C# MonoDevelop.GetCompilationAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoDevelop
的用法示例。
在下文中一共展示了MonoDevelop.GetCompilationAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTextWithDirective
string GetTextWithDirective (MonoDevelop.Ide.Gui.Document document, bool insertDirective)
{
string tag = Text;
if (!tag.Contains ("{0}"))
return tag;
if (Type.AssemblyName.StartsWith ("System.Web.UI.WebControls", StringComparison.Ordinal))
return string.Format (tag, "asp");
//register the assembly and look up the class
//FIXME: only do this on the insert, not the preview - or remove it afterwards
RegisterReference (document.Project);
var database = document.GetCompilationAsync ().Result;
var cls = database.GetTypeByMetadataName (Type.Load ().FullName);
if (cls == null)
return tag;
var ed = document.GetContent<WebFormsEditorExtension> ();
if (ed == null)
return tag;
var assemName = SystemAssemblyService.ParseAssemblyName (Type.AssemblyName);
WebFormsPageInfo.RegisterDirective directive;
string prefix = ed.ReferenceManager.GetTagPrefixWithNewDirective (cls, assemName.Name, null, out directive);
if (prefix == null)
return tag;
tag = string.Format (tag, prefix);
if (directive != null && insertDirective)
ed.ReferenceManager.AddRegisterDirective (directive, document.Editor, true);
return tag;
}