ICSharpCode.NRefactory.Utils.FastSerializer.EmitWriteValueType C# (CSharp) Method

EmitWriteValueType() public method

Stack transition: ..., value => ...
public EmitWriteValueType ( ILGenerator il, LocalBuilder writer, Type valType ) : void
il System.Reflection.Emit.ILGenerator
writer System.Reflection.Emit.LocalBuilder
valType System.Type
return void
		void EmitWriteValueType(ILGenerator il, LocalBuilder writer, Type valType)
		{
			Debug.Assert(valType.IsValueType);
			Debug.Assert(!(valType.IsEnum || valType.IsPrimitive));
			
			var fieldVal = il.DeclareLocal(valType);
			il.Emit(OpCodes.Stloc, fieldVal);
			
			foreach (FieldInfo field in GetSerializableFields(valType)) {
				EmitWriteField(il, writer, fieldVal, field);
			}
		}
		#endregion