Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


ISymbolDocumentWriter Interface

Definition

Represents a document referenced by a symbol store.

C#
public interface ISymbolDocumentWriter
C#
[System.Runtime.InteropServices.ComVisible(true)]
public interface ISymbolDocumentWriter
Derived
Attributes

Examples

The following code example demonstrates how an ISymbolDocumentWriter can be obtained when calling DefineDocument.

C#
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();
      }
   }
}

Remarks

A document is defined by a URL and a document type GUID. Optionally, the document source can be stored in the symbol store.

Megjegyzés

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.

Methods

SetCheckSum(Guid, Byte[])

Sets checksum information.

SetSource(Byte[])

Stores the raw source for a document in the symbol store.

Applies to

Termék Verziók
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also