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)); }
public IEnumerable <InheritanceNode> GetPath(InheritancePathDirection direction) { if (direction == InheritancePathDirection.SuperRootToTree) { return(this.pathNodes.ToArray()); } return(this.pathNodes.ToArray().Reverse()); }
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);*/ }
public string GetPathAsString(InheritancePathDirection direction, bool includeId) { return(GetPathAsString(direction, includeId, node => true)); }