ISymbolDocumentWriter ISymbolDocumentWriter ISymbolDocumentWriter ISymbolDocumentWriter Interface

定義

シンボル ストアによって参照されるドキュメントを表します。Represents a document referenced by a symbol store.

public interface class ISymbolDocumentWriter
[System.Runtime.InteropServices.ComVisible(true)]
public interface ISymbolDocumentWriter
type ISymbolDocumentWriter = interface
Public Interface ISymbolDocumentWriter
派生
属性

次のコード例に示す方法、ISymbolDocumentWriterを呼び出すときに取得できるDefineDocumentします。The following code example demonstrates how an ISymbolDocumentWriter can be obtained when calling DefineDocument.

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
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 'New
   End Class 'CodeGenerator

   Public Class CallerClass

      Public Shared Sub Main()
         Dim myGenerator As New CodeGenerator()
      End Sub 'Main
   End Class 'CallerClass
End Namespace 'ILGenServer

注釈

ドキュメントは、URL とドキュメントの種類の GUID によって定義されます。A document is defined by a URL and a document type GUID. 必要に応じて、ドキュメントのソースは、シンボル ストアに格納できます。Optionally, the document source can be stored in the symbol store.

注意

このインターフェイスは、マネージ、ISymUnmanagedDocumentWriterインターフェイスで、デバッグ シンボル情報を読み書きする別の方法を提供するアンマネージ シンボル ストア インターフェイスの 1 つです。This interface is the managed counterpart of the ISymUnmanagedDocumentWriter interface, which is one of the unmanaged symbol store interfaces that provide an alternate way to read and write debug symbol information.

メソッド

SetCheckSum(Guid, Byte[]) SetCheckSum(Guid, Byte[]) SetCheckSum(Guid, Byte[]) SetCheckSum(Guid, Byte[])

チェックサム情報を設定します。Sets checksum information.

SetSource(Byte[]) SetSource(Byte[]) SetSource(Byte[]) SetSource(Byte[])

ドキュメントの生ソースをシンボル ストアに格納します。Stores the raw source for a document in the symbol store.

適用対象

こちらもご覧ください