private void instrumentEditor_FormClosed(object sender, FormClosedEventArgs e) { InstrumentEditor editor = sender as InstrumentEditor; if (editor != null) { editor.InstrumentChanged -= new EventHandler(editor_InstrumentChanged); editor.FormClosed -= new FormClosedEventHandler(instrumentEditor_FormClosed); } }
private void mostrarEditorInstrumentos() { if (lstInstruments.SelectedItem != null) { InstrumentEditor editor = FormFactory.CreateOrActivateFormOfType <InstrumentEditor>(); editor.FormClosed -= new FormClosedEventHandler(instrumentEditor_FormClosed); editor.InstrumentChanged -= new EventHandler(editor_InstrumentChanged); editor.CurrentSong = this.currentSong; editor.CurrentInstrument = (Instrument)lstInstruments.SelectedItem; editor.InstrumentChanged += new EventHandler(editor_InstrumentChanged); editor.FormClosed += new FormClosedEventHandler(instrumentEditor_FormClosed); } }