static void Bind(InstructionVisitorDelegate handler, params OpCode[] opcodes) { foreach (OpCode op in opcodes) { _handlers.Add(op.Value, handler); } }
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); } }