Esempio n. 1
0
        protected override void OnEmit(OpCode opcode, Label arg)
        {
            var value = (int)typeof(Label)
                        .GetFields(BindingFlags.Instance | BindingFlags.NonPublic)
                        .First()
                        .GetValue(arg);

            ProcessInstruction(
                _ilProcessorField.Create(
                    opcode.ToCecil(),
                    _labelsField[value].LabeledInstruction
                    ));
        }
Esempio n. 2
0
        protected override void OnEmit(OpCode opcode, Type arg)
        {
            var           ts = _assemblyDefinitionField.MainModule.TypeSystem;
            TypeReference reference;

            if (arg == typeof(int))
            {
                reference = ts.Int32;
            }
            else
            {
                throw new NotSupportedException();
            }

            ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), reference));
        }
Esempio n. 3
0
        protected override void OnEmit(OpCode opcode, Label arg)
        {
            var value = (int)typeof(Label)
                .GetFields(BindingFlags.Instance | BindingFlags.NonPublic)
                .First()
                .GetValue(arg);

            ProcessInstruction(
                _ilProcessorField.Create(
                    opcode.ToCecil(), 
                    _labelsField[value].LabeledInstruction
                    ));
        }
Esempio n. 4
0
 protected override void OnEmit(OpCode opcode, double arg)
 {
     ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), arg));
 }
Esempio n. 5
0
        protected override void OnEmit(OpCode opcode, Type arg)
        {
            var ts = _assemblyDefinitionField.MainModule.TypeSystem;
            TypeReference reference;
            if (arg == typeof(int))
                reference = ts.Int32;
            else 
                throw  new NotSupportedException();

            ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), reference));
        }
Esempio n. 6
0
 protected override void OnEmit(OpCode opcode, ConstructorInfo arg)
 {
     var reference = _assemblyDefinitionField.MainModule.Import(arg);
     ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), reference));
 }
Esempio n. 7
0
 protected override void OnEmit(OpCode opcode, float arg)
 {
     ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), arg));
 }
Esempio n. 8
0
        protected override void OnEmit(OpCode opcode, ConstructorInfo arg)
        {
            var reference = _assemblyDefinitionField.MainModule.Import(arg);

            ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), reference));
        }
Esempio n. 9
0
 protected override void OnEmit(OpCode opcode)
 {
     ProcessInstruction(ilProcessorField.Create(opcode.ToCecil()));
 }
Esempio n. 10
0
	protected override void OnEmit(OpCode opcode, Type arg)
	{
		var ts = _assemblyDefinitionField.MainModule.TypeSystem;
		TypeReference reference;
		if (arg == typeof (bool))
			reference = ts.Boolean;
		else if (arg == typeof(byte))
			reference = ts.Byte;
		else if (arg == typeof(sbyte))
			reference = ts.SByte;
		else if (arg == typeof(short))
			reference = ts.Int16;
		else if (arg == typeof(ushort))
			reference = ts.UInt16;
		else if (arg == typeof(int))
			reference = ts.Int32;
		else if (arg == typeof(uint))
			reference = ts.UInt32;
		else if (arg == typeof(long))
			reference = ts.Int64;
		else if (arg == typeof(ulong))
			reference = ts.Int64;
		else if (arg == typeof(float))
			reference = ts.Single;
		else if (arg == typeof(double))
			reference = ts.Double;
		else if (arg == typeof(string))
			reference = ts.String;
		else if (arg == typeof(void))
			reference = ts.Void;
		else if (arg == typeof(object))
			reference = ts.Object;
		else
			reference = _assemblyDefinitionField.MainModule.Import(arg);

		ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), reference));
	}
Esempio n. 11
0
 protected override void OnEmit(OpCode opcode)
 {
     ProcessInstruction(ilProcessorField.Create(opcode.ToCecil()));
 }