public void ShiftDuration(int val) { var root_gene = this.Gene as NoteGene; root_gene.ShiftDuration(val); if (this.Children != null) { foreach (var c in this.Children) { if (c == null) continue; c.ShiftDuration(val); } } }