Beispiel #1
0
        public string GetPathAsString(InheritancePathDirection direction, bool includeId, Func <InheritanceNode, bool> predicate)
        {
            var pathItems = GetPath(direction).Where(predicate).Select(node => node.ToString());

            return(includeId
                       ? string.Format("Id:{0}> {1}", this.id, string.Join(" -> ", pathItems))
                       : string.Join(" -> ", pathItems));
        }
Beispiel #2
0
        public IEnumerable <InheritanceNode> GetPath(InheritancePathDirection direction)
        {
            if (direction == InheritancePathDirection.SuperRootToTree)
            {
                return(this.pathNodes.ToArray());
            }

            return(this.pathNodes.ToArray().Reverse());
        }
Beispiel #3
0
        public string ToString(InheritancePathDirection direction, bool includeId = true)
        {
            return(GetPathAsString(direction, includeId));

            /*var pathItems = GetPath(direction).Select(node => node.ToString());
             * return includeId
             *         ? string.Format("Id:{0}> {1}", this.id, string.Join(" -> ", pathItems))
             *         : string.Join(" -> ", pathItems);*/
        }
Beispiel #4
0
 public string GetPathAsString(InheritancePathDirection direction, bool includeId)
 {
     return(GetPathAsString(direction, includeId, node => true));
 }