Exemplo n.º 1
0
 public CustomAttribute(MethodReference constructor)
 {
     this.constructor = constructor;
     this.resolved    = true;
 }
Exemplo n.º 2
0
 public CustomAttribute(MethodReference constructor, byte [] blob)
 {
     this.constructor = constructor;
     this.resolved    = false;
     this.blob        = blob;
 }
Exemplo n.º 3
0
 internal CustomAttribute(uint signature, MethodReference constructor)
 {
     this.signature   = signature;
     this.constructor = constructor;
     this.resolved    = false;
 }
Exemplo n.º 4
0
 public MethodReference ImportReference(MethodReference method)
 {
     return(ImportReference(method, null));
 }
Exemplo n.º 5
0
 public MethodReference Import(MethodReference method, IGenericParameterProvider context)
 {
     return(ImportReference(method, context));
 }
Exemplo n.º 6
0
 internal MethodDefinition Resolve(MethodReference method)
 {
     return(MetadataResolver.Resolve(method));
 }
        public static MethodDefinition GetMethod(Collection <MethodDefinition> methods, MethodReference reference)
        {
            for (int i = 0; i < methods.Count; i++)
            {
                var method = methods [i];

                if (method.Name != reference.Name)
                {
                    continue;
                }

                if (method.HasGenericParameters != reference.HasGenericParameters)
                {
                    continue;
                }

                if (method.HasGenericParameters && method.GenericParameters.Count != reference.GenericParameters.Count)
                {
                    continue;
                }

                if (!AreSame(method.ReturnType, reference.ReturnType))
                {
                    continue;
                }

                if (method.IsVarArg() != reference.IsVarArg())
                {
                    continue;
                }

                if (method.IsVarArg() && IsVarArgCallTo(method, reference))
                {
                    return(method);
                }

                if (method.HasParameters != reference.HasParameters)
                {
                    continue;
                }

                if (!method.HasParameters && !reference.HasParameters)
                {
                    return(method);
                }

                if (!AreSame(method.Parameters, reference.Parameters))
                {
                    continue;
                }

                return(method);
            }

            return(null);
        }