MsgPack.Serialization.EmittingSerializers.SerializerEmitter.SerializerEmitter C# (CSharp) Method

SerializerEmitter() public method

Initializes a new instance of the SerializerEmitter class.
public SerializerEmitter ( ModuleBuilder host, SerializerSpecification specification, Type baseClass, bool isDebuggable ) : System
host System.Reflection.Emit.ModuleBuilder The host .
specification SerializerSpecification The specification of the serializer.
baseClass System.Type Type of the base class of the serializer.
isDebuggable bool Set to true when is debuggable.
return System
		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
		}

Same methods

SerializerEmitter::SerializerEmitter ( SerializationContext context, ModuleBuilder host, SerializerSpecification specification, bool isDebuggable ) : System