コード例 #1
0
 public static CodeSentence Create(XElement xCodeSentence)
 {
     return(new CodeSentence(
                CodeCommentList.Create(xCodeSentence.Element(CodeCommentList.ElementName)),
                (CodeCompoundTerm)CodeTerm.Create(xCodeSentence.Element(CodeTerm.ElementName)),
                CodeCompoundTermList.Create(xCodeSentence.Element(CodeCompoundTermList.ElementName))));
 }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            CodeCommentList rhs = obj as CodeCommentList;

            if (rhs == null)
            {
                return(false);
            }

            if (Count != rhs.Count)
            {
                return(false);
            }

            for (int idx = 0; idx < Count; ++idx)
            {
                if (this[idx] != rhs[idx])
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #3
0
        public CodeSentence(IEnumerable <CodeComment> comments, CodeCompoundTerm head, IEnumerable <CodeCompoundTerm> body)
        {
            if (comments == null)
            {
                m_comments = new CodeCommentList(new List <CodeComment>());
            }
            else
            {
                m_comments = new CodeCommentList(new List <CodeComment>(comments));
            }

            m_head = head;

            if (body == null)
            {
                m_body = new CodeCompoundTermList(new List <CodeCompoundTerm>());
            }
            else
            {
                m_body = new CodeCompoundTermList(new List <CodeCompoundTerm>(body));
            }
        }
コード例 #4
0
        public bool Equals(CodeCommentList other)
        {
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            if (Count != other.Count)
            {
                return(false);
            }

            for (var idx = 0; idx < Count; ++idx)
            {
                if (this[idx] != other[idx])
                {
                    return(false);
                }
            }

            return(true);
        }