public bool IsAtDepth(NodeDepth depth) { switch (depth) { case NodeDepth.KnotsOnly: return(Type == NodeType.Knot); case NodeDepth.KnotsAndStitches: return(Type != NodeType.Label); case NodeDepth.KnotsStitchesAndLabels: return(true); default: throw new ArgumentOutOfRangeException(nameof(depth), depth, null); } }
public int GetIdAtDepth(NodeDepth depth) { switch (depth) { case NodeDepth.KnotsOnly: return(KnotId); case NodeDepth.KnotsAndStitches: return(Type == NodeType.Knot ? Id : StitchId); case NodeDepth.KnotsStitchesAndLabels: return(Id); default: throw new ArgumentOutOfRangeException(nameof(depth), depth, null); } }