public MethodImplementation(TypeDefinition @class, MethodReference methodDeclaration, MethodReference newMethod) : base(new MetaDataRow(@class.TableIndex, 0U, newMethod.TableIndex)) { this._class = @class; this._methodDeclaration = methodDeclaration; this._methodBody = newMethod; }
public virtual MethodDefinition ResolveMethod(MethodReference methodRef) { var declaringType = ResolveType(methodRef.DeclaringType); methodRef = methodRef.GetElementMethod(); if (declaringType != null && declaringType.HasMethods) { foreach (var method in declaringType.Methods) { if (MethodRefsAreEqual(method, methodRef)) { return method; } } } return null; }
public MethodSpecification(MethodReference methodRef) { OriginalMethod = methodRef; }
protected virtual bool MethodRefsAreEqual(MethodReference reference1, MethodReference reference2) { if (reference1 == null || reference2 == null) return false; if (!TypeRefsAreEqual(reference1.DeclaringType, reference2.DeclaringType)) return false; if (reference1.Name != reference2.Name) return false; if (reference1.Signature == null || reference2.Signature == null) return false; if (!TypeRefsAreEqual(reference1.Signature.ReturnType, reference2.Signature.ReturnType)) return false; if (reference1.Signature.HasParameters != reference2.Signature.HasParameters) return false; if (reference1.Signature.HasParameters && reference2.Signature.HasParameters) { if (reference1.Signature.Parameters.Length != reference2.Signature.Parameters.Length) return false; for (int i = 0; i < reference1.Signature.Parameters.Length; i++) { if (!TypeRefsAreEqual(reference1.Signature.Parameters[i].ParameterType, reference2.Signature.Parameters[i].ParameterType)) { return false; } } } if (reference1.HasGenericParameters && reference2.HasGenericParameters) { if (reference1.GenericParameters.Length != reference2.GenericParameters.Length) return false; } return true; }
public override void LoadCache() { _class = Class; _methodBody = MethodBody; _methodDeclaration = MethodDeclaration; }
public override void ClearCache() { _class = null; _methodBody = null; _methodDeclaration = null; }
public override void ClearCache() { _parent = null; _constructor = null; _signature = null; }
public override void LoadCache() { _parent = Parent; _constructor = Constructor; _signature = Signature; }
public CustomAttribute(MetaDataMember parent, MethodReference constructor, uint value) : base(new MetaDataRow(0U,0U, value)) { this._parent = parent; this._constructor = constructor; }
public CustomAttribute(MetaDataMember parent, MethodReference constructor, uint value) : base(new MetaDataRow(0U, 0U, value)) { this._parent = parent; this._constructor = constructor; }
public MethodSpecification(MethodReference methodRef) : base(default(MetaDataRow)) { OriginalMethod = methodRef; _context = methodRef; }