本文整理匯總了C#中Mono.CSharp.DynamicLoader.Dispose方法的典型用法代碼示例。如果您正苦於以下問題:C# DynamicLoader.Dispose方法的具體用法?C# DynamicLoader.Dispose怎麽用?C# DynamicLoader.Dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.CSharp.DynamicLoader
的用法示例。
在下文中一共展示了DynamicLoader.Dispose方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Compile
//.........這裏部分代碼省略.........
return false;
// System.Object was not loaded, use compiled assembly as corlib
if (loader.Corlib == null)
loader.Corlib = assembly.Builder;
loader.LoadModules (assembly, module.GlobalRootNamespace);
#else
var assembly = new AssemblyDefinitionDynamic (module, output_file_name, output_file);
module.SetDeclaringAssembly (assembly);
var importer = new ReflectionImporter (ctx.BuildinTypes);
assembly.Importer = importer;
var loader = new DynamicLoader (importer, ctx);
loader.LoadReferences (module);
ShowTime ("Imporing referenced assemblies");
if (!ctx.BuildinTypes.CheckDefinitions (module))
return false;
ShowTime ("Initializing predefined types");
if (!assembly.Create (AppDomain.CurrentDomain, AssemblyBuilderAccess.Save))
return false;
loader.LoadModules (assembly, module.GlobalRootNamespace);
#endif
module.Define ();
ShowTime ("Types definition");
if (Report.Errors > 0)
return false;
if (Report.Errors == 0 &&
RootContext.Documentation != null &&
!RootContext.Documentation.OutputDocComment (
output_file, Report))
return false;
//
// Verify using aliases now
//
NamespaceEntry.VerifyAllUsing ();
if (Report.Errors > 0){
return false;
}
assembly.Resolve ();
if (Report.Errors > 0)
return false;
//
// The code generator
//
if (timestamps)
stopwatch = Stopwatch.StartNew ();
assembly.Emit ();
ShowTime ("Resolving and emitting members blocks");
if (Report.Errors > 0){
return false;
}
module.CloseType ();
ShowTime ("Closing types");
if (timestamps)
stopwatch = Stopwatch.StartNew ();
assembly.EmbedResources ();
ShowTime ("Embedding resources");
if (Report.Errors > 0)
return false;
if (timestamps)
stopwatch = Stopwatch.StartNew ();
assembly.Save ();
#if STATIC
loader.Dispose ();
#endif
ShowTime ("Saving output assembly");
ShowTotalTime ("Total");
Timer.ShowTimers ();
return (Report.Errors == 0);
}