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

            ProcessInstruction(_ilProcessorField.Create(opcode.ToCecil(), reference));
        }
Пример #9
0
 protected override void OnEmit(OpCode opcode)
 {
     ProcessInstruction(ilProcessorField.Create(opcode.ToCecil()));
 }
Пример #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));
	}
Пример #11
0
 protected override void OnEmit(OpCode opcode)
 {
     ProcessInstruction(ilProcessorField.Create(opcode.ToCecil()));
 }