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)))); }
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); }
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)); } }
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); }