public void CopyTo(MethodDeclaration copy) { copy._name = _name; copy._sigType = _sigType; copy._flags = _flags; copy._implFlags = _implFlags; if (PInvoke != null) { PInvoke.CopyTo(copy.CreatePInvoke()); } ReturnType.CopyTo(copy.ReturnType); Parameters.CopyTo(copy.Parameters); GenericParameters.CopyTo(copy.GenericParameters); Overrides.CopyTo(copy.Overrides); CustomAttributes.CopyTo(copy.CustomAttributes); SecurityAttributes.CopyTo(copy.SecurityAttributes); if (MethodBody.IsValid(this)) { var methodBody = MethodBody.Load(this); methodBody.Build(copy); } }