// 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; }
// 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); }