コード例 #1
0
ファイル: Checker.cs プロジェクト: hesam/SketchSharp
 private bool MemberIsRep (Member m) {
   if (m == null) return false;
   return m.GetAttribute(SystemTypes.RepAttribute) != null;
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
            }
        }