Exemple #1
0
        // Returns the previous method, or null if none
        public MethodDef addMethod(MethodDef ifaceMethod, MethodDef classMethod)
        {
            var ifaceKey = new MethodDefKey(ifaceMethod);
            if (!ifaceMethodToClassMethod.ContainsKey(ifaceKey))
                throw new ApplicationException("Could not find interface method");

            MethodDef oldMethod;
            ifaceMethodToClassMethod.TryGetValue(ifaceKey, out oldMethod);
            ifaceMethodToClassMethod[ifaceKey] = classMethod;
            return oldMethod;
        }
Exemple #2
0
        // Returns the previous method, or null if none
        public MMethodDef AddMethod(MMethodDef ifaceMethod, MMethodDef classMethod)
        {
            var ifaceKey = new MethodDefKey(ifaceMethod);

            if (!ifaceMethodToClassMethod.ContainsKey(ifaceKey))
            {
                throw new ApplicationException("Could not find interface method");
            }

            MMethodDef oldMethod;

            ifaceMethodToClassMethod.TryGetValue(ifaceKey, out oldMethod);
            ifaceMethodToClassMethod[ifaceKey] = classMethod;
            return(oldMethod);
        }