public TreeNode GetNextSiblingWithManagedAudio() { if (Parent == null) { return(null); } TreeNode next = this; while ((next = next.NextSibling) != null) { #if ENABLE_SEQ_MEDIA Media manMedia = next.GetManagedAudioMediaOrSequenceMedia(); #else Media manMedia = next.GetManagedAudioMedia(); #endif if (manMedia != null) { return(next); } TreeNode nextIn = next.GetFirstDescendantWithManagedAudio(); if (nextIn != null) { return(nextIn); } } return(Parent.GetNextSiblingWithManagedAudio()); }