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

            MethodDef oldMethod;
            ifaceMethodToClassMethod.TryGetValue(ifaceMethod, out oldMethod);
            ifaceMethodToClassMethod[ifaceMethod] = classMethod;
            return oldMethod;
        }
Example #2
0
 public void addMethodIfEmpty(MethodDef ifaceMethod, MethodDef classMethod)
 {
     if (ifaceMethodToClassMethod[ifaceMethod] == null)
         addMethod(ifaceMethod, classMethod);
 }
Example #3
0
 public void add(MethodDef m)
 {
     methods.add(m);
 }
Example #4
0
 public void addMethodIfEmpty(TypeInfo iface, MethodDef ifaceMethod, MethodDef classMethod)
 {
     InterfaceMethodInfo info;
     var key = new TypeReferenceKey(iface.typeReference);
     if (!interfaceMethods.TryGetValue(key, out info))
         throw new ApplicationException("Could not find interface");
     info.addMethodIfEmpty(ifaceMethod, classMethod);
 }
Example #5
0
 public MethodInst(MethodDef origMethodDef, MethodReference methodReference)
 {
     this.origMethodDef = origMethodDef;
     this.methodReference = methodReference;
 }
Example #6
0
 // Returns the previous classMethod, or null if none
 public MethodDef addMethod(TypeInfo iface, MethodDef ifaceMethod, MethodDef classMethod)
 {
     return addMethod(iface.typeReference, ifaceMethod, classMethod);
 }
Example #7
0
 public void add(MethodDef method)
 {
     methods.Add(method);
 }
Example #8
0
 public void same(MethodDef a, MethodDef b)
 {
     merge(get(a), get(b));
 }
Example #9
0
 public MethodNameScope get(MethodDef method)
 {
     if (!method.isVirtual())
         throw new ApplicationException("Not a virtual method");
     MethodNameScope scope;
     if (!methodScopes.TryGetValue(method, out scope)) {
         methodScopes[method] = scope = new MethodNameScope();
         scope.add(method);
     }
     return scope;
 }
Example #10
0
 public void add(MethodDef methodDef)
 {
     get(methodDef);
 }