本文整理汇总了C#中System.Diagnostics.SymbolStore.SymLanguageType类的典型用法代码示例。如果您正苦于以下问题:C# SymLanguageType类的具体用法?C# SymLanguageType怎么用?C# SymLanguageType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SymLanguageType类属于System.Diagnostics.SymbolStore命名空间,在下文中一共展示了SymLanguageType类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CodeGenerator
//引入命名空间
using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Diagnostics.SymbolStore;
namespace ILGenServer
{
public class CodeGenerator
{
ModuleBuilder myModuleBuilder ;
AssemblyBuilder myAssemblyBuilder ;
public CodeGenerator()
{
// Get the current application domain for the current thread.
AppDomain currentDomain = AppDomain.CurrentDomain;
AssemblyName myAssemblyName = new AssemblyName();
myAssemblyName.Name = "TempAssembly";
// Define a dynamic assembly in the current domain.
myAssemblyBuilder =
currentDomain.DefineDynamicAssembly
(myAssemblyName, AssemblyBuilderAccess.RunAndSave);
// Define a dynamic module in "TempAssembly" assembly.
myModuleBuilder =
myAssemblyBuilder.DefineDynamicModule("TempModule","Resource.mod",true);
// Define a document for source.on 'TempModule' module.
ISymbolDocumentWriter myDocument =
myModuleBuilder.DefineDocument("RTAsm.il", SymDocumentType.Text,
SymLanguageType.ILAssembly,SymLanguageVendor.Microsoft);
Console.WriteLine("The object representing the defined document is:"+myDocument);
}
}
public class CallerClass
{
public static void Main()
{
CodeGenerator myGenerator = new CodeGenerator();
}
}
}