SymLanguageVendor 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
保留要用於符號存放區的語言廠商之公用 GUID。
public ref class SymLanguageVendor
public class SymLanguageVendor
[System.Runtime.InteropServices.ComVisible(true)]
public class SymLanguageVendor
type SymLanguageVendor = class
[<System.Runtime.InteropServices.ComVisible(true)>]
type SymLanguageVendor = class
Public Class SymLanguageVendor
- 繼承
-
SymLanguageVendor
- 屬性
範例
下列程式代碼範例示範呼叫 DefineDocument時如何使用 SymLanguageVendor 。
using namespace System;
using namespace System::Reflection;
using namespace System::Reflection::Emit;
using namespace System::Resources;
using namespace System::Diagnostics::SymbolStore;
public ref class CodeGenerator
{
private:
ModuleBuilder^ myModuleBuilder;
AssemblyBuilder^ myAssemblyBuilder;
public:
CodeGenerator()
{
// Get the current application domain for the current thread.
AppDomain^ currentDomain = AppDomain::CurrentDomain;
AssemblyName^ myAssemblyName = gcnew AssemblyName;
myAssemblyName->Name = "TempAssembly";
// Define a dynamic assembly in the current domain.
myAssemblyBuilder = currentDomain->DefineDynamicAssembly( myAssemblyName, AssemblyBuilderAccess::RunAndSave );
// Define a dynamic module in S"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: {0}", myDocument );
}
};
int main()
{
CodeGenerator^ myGenerator = gcnew 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();
}
}
}
Imports System.Reflection
Imports System.Reflection.Emit
Imports System.Resources
Imports System.Diagnostics.SymbolStore
Namespace ILGenServer
Public Class CodeGenerator
Private myModuleBuilder As ModuleBuilder
Private myAssemblyBuilder As AssemblyBuilder
Public Sub New()
' Get the current application domain for the current thread.
Dim currentDomain As AppDomain = AppDomain.CurrentDomain
Dim myAssemblyName As 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.
Dim myDocument As ISymbolDocumentWriter = myModuleBuilder.DefineDocument("RTAsm.il", _
SymDocumentType.Text, SymLanguageType.ILAssembly, SymLanguageVendor.Microsoft)
Console.WriteLine("The object representing the defined document is:" + _
CObj(myDocument).ToString())
End Sub
End Class
Public Class CallerClass
Public Shared Sub Main()
Dim myGenerator As New CodeGenerator()
End Sub
End Class
End Namespace 'ILGenServer
建構函式
SymLanguageVendor() |
初始化 SymLanguageVendor 類別的新執行個體。 |
欄位
Microsoft |
指定 Microsoft 語言廠商的 GUID。 |
方法
Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
GetHashCode() |
做為預設雜湊函式。 (繼承來源 Object) |
GetType() |
取得目前執行個體的 Type。 (繼承來源 Object) |
MemberwiseClone() |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
ToString() |
傳回代表目前物件的字串。 (繼承來源 Object) |