static Boolean isBinary(Component c) { if (c.GetChilds() == null) { return(true); } Boolean isNodeBinary = c.isBinary(); foreach (Component child in c.GetChilds()) { isNodeBinary = isNodeBinary && isBinary(child); } return(isNodeBinary); }