Exemplo 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
                    ));
        }
Exemplo 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));
        }
Exemplo 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
                    ));
        }
Exemplo n.º 4
0
 protected override void OnEmit(OpCode opcode, double arg)
 {
     ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), arg));
 }
Exemplo 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));
        }
Exemplo n.º 6
0
 protected override void OnEmit(OpCode opcode, ConstructorInfo arg)
 {
     var reference = _assemblyDefinitionField.MainModule.Import(arg);
     ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), reference));
 }
Exemplo n.º 7
0
 protected override void OnEmit(OpCode opcode, float arg)
 {
     ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), arg));
 }
Exemplo n.º 8
0
        protected override void OnEmit(OpCode opcode, ConstructorInfo arg)
        {
            var reference = _assemblyDefinitionField.MainModule.Import(arg);

            ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), reference));
        }
Exemplo n.º 9
0
 protected override void OnEmit(OpCode opcode)
 {
     ProcessInstruction(ilProcessorField.Create(opcode.ToCecil()));
 }
Exemplo 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));
	}
Exemplo n.º 11
0
 protected override void OnEmit(OpCode opcode)
 {
     ProcessInstruction(ilProcessorField.Create(opcode.ToCecil()));
 }