protected void GetChildren(ModelBone parent, ref ModelBoneCollection list) { foreach (ModelBone child in parent.Children) { list.Add(child); child.GetChildren(child, ref list); } }
public ModelBoneCollection AllChildren(bool includeSelf = true) { ModelBoneCollection childs = new ModelBoneCollection(); if (includeSelf) { childs.Add(this); } GetChildren(this, ref childs); return(childs); }