private bool MemberIsRep (Member m) { if (m == null) return false; return m.GetAttribute(SystemTypes.RepAttribute) != null; }
private static bool IsDebuggerNonUserCodeMemberOnly(Member m) { if (m == null) return false; if (debuggerNonUserCodeAttributeNode == null) return false; if (m.GetAttribute(debuggerNonUserCodeAttributeNode) != null) return true; return false; }
private void CopyAttributesWithoutDuplicateUnlessAllowMultiple(Member targetMember, Member sourceMember) { Contract.Requires(targetMember != null); Contract.Requires(sourceMember != null); // if (sourceMember.Attributes == null) return; // if (targetMember.Attributes == null) targetMember.Attributes = new AttributeList(); var attrs = this.outOfBandDuplicator.VisitAttributeList(sourceMember.Attributes); Contract.Assume(attrs != null, "We fail to specialize the ensures"); foreach (var a in attrs) { if (a == null) continue; // Can't look at a.Type because that doesn't get visited by the VisitAttributeList above // (Seems like a bug in the StandardVisitor...) TypeNode typeOfA = AttributeType(a); if (!a.AllowMultiple && targetMember.GetAttribute(typeOfA) != null) { continue; } targetMember.Attributes.Add(a); } }