Skip to Main Content
C# in a Nutshell, Second Edition
book

C# in a Nutshell, Second Edition

by Peter Drayton, Ben Albahari, Ted Neward
August 2003
Intermediate to advanced content levelIntermediate to advanced
928 pages
32h 1m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell, Second Edition

Name

ModuleBuilder

Synopsis

This class represents a dynamically created module inside a dynamic assembly. Dynamic modules are created with the AssemblyBuilder.DefineDynamicModule( ) method. A dynamic module can be either transient or persistable, which means you can save it to disk as part of a PE file. To create a persistable module, use a version of the AssemblyBuilder.DefineDynamicModule( ) method that allows you to specify a filename.

You can use the methods that begin with Define to create types, managed and unmanaged resources, global methods, and PInvoke (global native) methods.

public class ModuleBuilder : System.Reflection.Module {
// Public Instance Properties
   public override string FullyQualifiedName{get; }   
// overrides System.Reflection.Module
                  // Public Instance Methods
   public void CreateGlobalFunctions( );
   public ISymbolDocumentWriter DefineDocument(string url, Guid language, Guid languageVendor,
       Guid documentType);
   public EnumBuilder DefineEnum(string name, System.Reflection.TypeAttributes visibility, 
        Type underlyingType);
   public MethodBuilder DefineGlobalMethod(string name, System.Reflection.MethodAttributes attributes,
       System.Reflection.CallingConventions callingConvention,Type returnType, Type[ ] parameterTypes);
   public MethodBuilder DefineGlobalMethod(string name, System.Reflection.MethodAttributes attributes,
       Type returnType, Type[ ] parameterTypes);
   public FieldBuilder DefineInitializedData(string name, byte[ ] data, 
        System.Reflection.FieldAttributes attributes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# in a Nutshell

C# in a Nutshell

Ben Albahari, Ted Neward, Peter Drayton
C# 7.0 in a Nutshell

C# 7.0 in a Nutshell

Joseph Albahari, Ben Albahari
C# Cookbook, 2nd Edition

C# Cookbook, 2nd Edition

Jay Hilyard, Stephen Teilhet
C# Cookbook

C# Cookbook

Joe Mayo

Publisher Resources

ISBN: 0596005261Catalog PageErrata