Exemple #1
0
 static void Bind(InstructionVisitorDelegate handler, params OpCode[] opcodes)
 {
     foreach (OpCode op in opcodes)
     {
         _handlers.Add(op.Value, handler);
     }
 }
Exemple #2
0
        public static void Dispatch(Instruction instruction, IInstructionVisitor visitor)
        {
            InstructionVisitorDelegate handler = (InstructionVisitorDelegate)_handlers[instruction.OpCode.Value];

            if (null == handler)
            {
                throw new ArgumentException(Formatter.FormatInstruction(instruction), "instruction");
            }
            handler(visitor, instruction);
        }
		static void Bind (InstructionVisitorDelegate handler, params OpCode[] opcodes)
		{
			foreach (OpCode op in opcodes)
			{
				_handlers.Add (op.Value, handler);
			}
		}