void TreeNodePlaybackHandler_PlayHandlingEnded(object sender, EventArgs e) { TreeNodePlaybackHandler handler = sender as TreeNodePlaybackHandler; if (handler != null) { handler.PlayHandlingEnded -= new EventHandler(TreeNodePlaybackHandler_PlayHandlingEnded); handler.Dispose(); } }
public void play(TreeNode node, Channel audioCh, bool contAfterNode) { if (node == null) { throw new exception.MethodParameterIsNullException("Can not play a null TreeNode"); } if (audioCh == null) { throw new exception.MethodParameterIsNullException("The audio channel to play was null"); } TreeNodePlaybackHandler playbackHandler = new TreeNodePlaybackHandler(node, audioCh, contAfterNode, this); playbackHandler.PlayHandlingEnded += new EventHandler(TreeNodePlaybackHandler_PlayHandlingEnded); playbackHandler.play(); }