private void AddLongKey(object[] args, MethodInvoker target) { switch (_argumentCount) { case 1: LongKey1 key1 = new LongKey1(args); AddKey(key1, target); break; case 2: LongKey2 key2 = new LongKey2(args); AddKey(key2, target); break; case 3: LongKey3 key3 = new LongKey3(args); AddKey(key3, target); break; default: LongKey4 key4 = new LongKey4(args); AddKey(key4, target); break; } }
private MethodInvoker MatchLongKey(object[] args) { MethodInvoker target = null; switch (_argumentCount) { case 1: LongKey1 key1 = new LongKey1(args); (_matches as SortedList <LongKey1, MethodInvoker>).TryGetValue(key1, out target); break; case 2: LongKey2 key2 = new LongKey2(args); (_matches as SortedList <LongKey2, MethodInvoker>).TryGetValue(key2, out target); break; case 3: LongKey3 key3 = new LongKey3(args); (_matches as SortedList <LongKey3, MethodInvoker>).TryGetValue(key3, out target); break; default: LongKey4 key4 = new LongKey4(args); (_matches as SortedList <LongKey4, MethodInvoker>).TryGetValue(key4, out target); break; } return(target); }