public SerializerEmitter( ModuleBuilder host, SerializerSpecification specification, Type baseClass, bool isDebuggable )
{
Contract.Requires( host != null );
Contract.Requires( specification != null );
Contract.Requires( baseClass != null );
Tracer.Emit.TraceEvent( Tracer.EventType.DefineType, Tracer.EventId.DefineType, "Create {0}", specification.SerializerTypeFullName );
this._methodTable = new Dictionary<string, MethodBuilder>();
this._fieldTable = new Dictionary<string, FieldBuilder>();
this._specification = specification;
this._host = host;
this._typeBuilder =
host.DefineType(
specification.SerializerTypeFullName,
TypeAttributes.Sealed | TypeAttributes.Public | TypeAttributes.UnicodeClass | TypeAttributes.AutoLayout | TypeAttributes.BeforeFieldInit,
baseClass
);
#if DEBUG
Contract.Assert( this._typeBuilder.BaseType != null, "baseType != null" );
#endif // DEBUG
this._isDebuggable = isDebuggable;
#if DEBUG && !NETFX_35 && !NETSTANDARD1_1 && !NETSTANDARD1_3
if ( isDebuggable && SerializerDebugging.DumpEnabled )
{
SerializerDebugging.PrepareDump( host.Assembly as AssemblyBuilder );
}
#endif // DEBUG && !NETFX_35 && !NETSTANDARD1_1 && !NETSTANDARD1_3
}