Skip to content

Instantly share code, notes, and snippets.

@pietervp
Created June 29, 2012 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pietervp/3018279 to your computer and use it in GitHub Desktop.
Save pietervp/3018279 to your computer and use it in GitHub Desktop.
var typeBuilder = _assemblyBuilder.DefineType(GetGeneratedTypeName(), typeof(object), InterfaceToImplement);
//create private field
var classToWrapField = typeBuilder.DefineField(GetGeneratedToWrapFieldName(), ClassToWrap, FieldAttributes.Private);
//map interface members
MapInterfaceProperties(classToWrapField, typeBuilder);
MapInterfaceEvents(classToWrapField, typeBuilder);
MapInterfaceMethods(classToWrapField, typeBuilder);
//define constructor
DefineConstructor(classToWrapField, typeBuilder);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment