示例#1
0
        public override string ToString()
        {
            string childrenStrs = Behaviors.Aggregate(string.Empty, (current, b) => current + b.ToString() + "\r\n\t");

            return(String.Format("{0} {6} ({5}) IsDone {3}\r\n" +
                                 "{1} {2}\r\n" +
                                 "Children:\r\n{4}",
                                 Type,
                                 Parent != null ? "Parent[" + Parent.GetHashCode().ToString() + "]" : "",
                                 TopParent != null ? "TopParent[" + TopParent.GetHashCode().ToString() + "]" : "",
                                 IsDone,
                                 childrenStrs,
                                 GetHashCode().ToString(), Name));
        }
示例#2
0
        public IEnumerable <UmlAssociationEndNode> GetAssociationEnds(bool end1, bool end2)
        {
            foreach (UmlAssociationEndNode assocEnd in TopParent.GetAllNodes().Where(r => r.Value is UmlAssociationEndNode).Select(r => r.Value))
            {
                if (assocEnd.Reference?.NodeId != Id)
                {
                    continue;
                }

                if (!end1 && assocEnd == assocEnd.ParentAssociation.End1)
                {
                    continue;
                }
                if (!end2 && assocEnd == assocEnd.ParentAssociation.End2)
                {
                    continue;
                }

                yield return(assocEnd);
            }
        }