本文整理汇总了C#中LoadedAssembly.IsNet45方法的典型用法代码示例。如果您正苦于以下问题:C# LoadedAssembly.IsNet45方法的具体用法?C# LoadedAssembly.IsNet45怎么用?C# LoadedAssembly.IsNet45使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoadedAssembly
的用法示例。
在下文中一共展示了LoadedAssembly.IsNet45方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DecompileAssembly
public override void DecompileAssembly(LoadedAssembly assembly, ITextOutput output, DecompilationOptions options)
{
if (options.FullDecompilation && options.SaveAsProjectDirectory != null) {
var decompiler = new VBProjectDecompiler();
decompiler.Decompile(this, assembly, output, options);
} else {
base.DecompileAssembly(assembly, output, options);
output.WriteLine();
ModuleDefinition mainModule = assembly.ModuleDefinition;
if (mainModule.EntryPoint != null) {
output.Write("' Entry point: ");
output.WriteReference(mainModule.EntryPoint.DeclaringType.FullName + "." + mainModule.EntryPoint.Name, mainModule.EntryPoint);
output.WriteLine();
}
WriteCommentLine(output, "Architecture: " + CSharpLanguage.GetPlatformDisplayName(mainModule));
if ((mainModule.Attributes & ModuleAttributes.ILOnly) == 0) {
WriteCommentLine(output, "This assembly contains unmanaged code.");
}
switch (mainModule.Runtime) {
case TargetRuntime.Net_1_0:
WriteCommentLine(output, "Runtime: .NET 1.0");
break;
case TargetRuntime.Net_1_1:
WriteCommentLine(output, "Runtime: .NET 1.1");
break;
case TargetRuntime.Net_2_0:
WriteCommentLine(output, "Runtime: .NET 2.0");
break;
case TargetRuntime.Net_4_0:
if (assembly.IsNet45())
{
WriteCommentLine(output, "Runtime: .NET 4.5");
}
else
{
WriteCommentLine(output, "Runtime: .NET 4.0");
}
break;
}
output.WriteLine();
// don't automatically load additional assemblies when an assembly node is selected in the tree view
using (options.FullDecompilation ? null : LoadedAssembly.DisableAssemblyLoad()) {
AstBuilder codeDomBuilder = CreateAstBuilder(options, currentModule: assembly.ModuleDefinition);
codeDomBuilder.AddAssembly(assembly.ModuleDefinition, onlyAssemblyLevel: !options.FullDecompilation);
RunTransformsAndGenerateCode(codeDomBuilder, output, options, assembly.ModuleDefinition);
}
}
}