本文整理汇总了C#中Mono.CSharp.ModuleContainer.CreateRootNamespace方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleContainer.CreateRootNamespace方法的具体用法?C# ModuleContainer.CreateRootNamespace怎么用?C# ModuleContainer.CreateRootNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.ModuleContainer
的用法示例。
在下文中一共展示了ModuleContainer.CreateRootNamespace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadReferences
/// <summary>
/// Loads all assemblies referenced on the command line
/// </summary>
public void LoadReferences (ModuleContainer module)
{
Assembly a;
var loaded = new List<Tuple<RootNamespace, Assembly>> ();
//
// Load Core Library for default compilation
//
if (RootContext.StdLib) {
a = LoadAssemblyFile ("mscorlib", false);
if (a != null)
loaded.Add (Tuple.Create (module.GlobalRootNamespace, a));
}
foreach (string r in default_references) {
a = LoadAssemblyFile (r, true);
if (a != null)
loaded.Add (Tuple.Create (module.GlobalRootNamespace, a));
}
foreach (string r in RootContext.AssemblyReferences) {
a = LoadAssemblyFile (r, false);
if (a == null)
continue;
var key = Tuple.Create (module.GlobalRootNamespace, a);
if (loaded.Contains (key))
continue;
loaded.Add (key);
}
foreach (var entry in RootContext.AssemblyReferencesAliases) {
a = LoadAssemblyFile (entry.Item2, false);
if (a == null)
continue;
var key = Tuple.Create (module.CreateRootNamespace (entry.Item1), a);
if (loaded.Contains (key))
continue;
loaded.Add (key);
}
foreach (var entry in loaded) {
importer.ImportAssembly (entry.Item2, entry.Item1);
}
}