本文整理汇总了C#中ImageFileMachine.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ImageFileMachine.ToString方法的具体用法?C# ImageFileMachine.ToString怎么用?C# ImageFileMachine.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageFileMachine
的用法示例。
在下文中一共展示了ImageFileMachine.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
void Save (string assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
{
this.peKind = portableExecutableKind;
this.machine = imageFileMachine;
if ((peKind & PortableExecutableKinds.PE32Plus) != 0 || (peKind & PortableExecutableKinds.Unmanaged32Bit) != 0)
throw new NotImplementedException (peKind.ToString ());
if (machine == ImageFileMachine.IA64 || machine == ImageFileMachine.AMD64)
throw new NotImplementedException (machine.ToString ());
if (resource_writers != null) {
foreach (IResourceWriter writer in resource_writers) {
writer.Generate ();
writer.Close ();
}
}
// Create a main module if not already created
ModuleBuilder mainModule = null;
if (modules != null) {
foreach (ModuleBuilder module in modules)
if (module.FullyQualifiedName == assemblyFileName)
mainModule = module;
}
if (mainModule == null)
mainModule = DefineDynamicModule ("RefEmit_OnDiskManifestModule", assemblyFileName);
if (!is_module_only)
mainModule.IsMain = true;
/*
* Create a new entry point if the one specified
* by the user is in another module.
*/
if ((entry_point != null) && entry_point.DeclaringType.Module != mainModule) {
Type[] paramTypes;
if (entry_point.GetParametersCount () == 1)
paramTypes = new Type [] { typeof (string) };
else
paramTypes = Type.EmptyTypes;
MethodBuilder mb = mainModule.DefineGlobalMethod ("__EntryPoint$", MethodAttributes.Static|MethodAttributes.PrivateScope, entry_point.ReturnType, paramTypes);
ILGenerator ilgen = mb.GetILGenerator ();
if (paramTypes.Length == 1)
ilgen.Emit (OpCodes.Ldarg_0);
ilgen.Emit (OpCodes.Tailcall);
ilgen.Emit (OpCodes.Call, entry_point);
ilgen.Emit (OpCodes.Ret);
entry_point = mb;
}
if (version_res != null)
DefineVersionInfoResourceImpl (assemblyFileName);
if (sn != null) {
// runtime needs to value to embed it into the assembly
public_key = sn.PublicKey;
}
foreach (ModuleBuilder module in modules)
if (module != mainModule)
module.Save ();
// Write out the main module at the end, because it needs to
// contain the hash of the other modules
mainModule.Save ();
if ((sn != null) && (sn.CanSign)) {
sn.Sign (System.IO.Path.Combine (this.AssemblyDir, assemblyFileName));
}
created = true;
}