本文整理汇总了C#中ICSharpCode.ILSpy.LoadedAssembly.IsNet45方法的典型用法代码示例。如果您正苦于以下问题:C# LoadedAssembly.IsNet45方法的具体用法?C# LoadedAssembly.IsNet45怎么用?C# LoadedAssembly.IsNet45使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.ILSpy.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 CSharpProjectDecompiler();
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();
}
output.WriteLine("// Architecture: " + GetPlatformDisplayName(mainModule));
if ((mainModule.Attributes & ModuleAttributes.ILOnly) == 0) {
output.WriteLine("// This assembly contains unmanaged code.");
}
switch (mainModule.Runtime) {
case TargetRuntime.Net_1_0:
output.WriteLine("// Runtime: .NET 1.0");
break;
case TargetRuntime.Net_1_1:
output.WriteLine("// Runtime: .NET 1.1");
break;
case TargetRuntime.Net_2_0:
output.WriteLine("// Runtime: .NET 2.0");
break;
case TargetRuntime.Net_4_0:
output.WriteLine(assembly.IsNet45() ? "// Runtime: .NET 4.5" : "// 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);
codeDomBuilder.RunTransformations(transformAbortCondition);
codeDomBuilder.GenerateCode(output);
}
}
}