示例#1
0
        private void AddIntKey(object[] args, MethodInvoker target)
        {
            switch (_argumentCount)
            {
            case 1:
                IntKey1 key1 = new IntKey1(args);
                AddKey(key1, target);
                break;

            case 2:
                IntKey2 key2 = new IntKey2(args);
                AddKey(key2, target);
                break;

            case 3:
                IntKey3 key3 = new IntKey3(args);
                AddKey(key3, target);
                break;

            default:
                IntKey4 key4 = new IntKey4(args);
                AddKey(key4, target);
                break;
            }
        }
示例#2
0
        private MethodInvoker MatchIntKey(object[] args)
        {
            MethodInvoker target = null;

            switch (_argumentCount)
            {
            case 1:
                IntKey1 key1 = new IntKey1(args);
                (_matches as SortedList <IntKey1, MethodInvoker>).TryGetValue(key1, out target);
                break;

            case 2:
                IntKey2 key2 = new IntKey2(args);
                (_matches as SortedList <IntKey2, MethodInvoker>).TryGetValue(key2, out target);
                break;

            case 3:
                IntKey3 key3 = new IntKey3(args);
                (_matches as SortedList <IntKey3, MethodInvoker>).TryGetValue(key3, out target);
                break;

            default:
                IntKey4 key4 = new IntKey4(args);
                (_matches as SortedList <IntKey4, MethodInvoker>).TryGetValue(key4, out target);
                break;
            }

            return(target);
        }