var musicapp = new classicalmusicapp(); musicapp.onprestarting += (s, e) => console.writeline("pre-starting preparations complete, ready to sidestep any prohibited actions."); for(int i = 0; i < musicapp.details.count; i++) { var detail = musicapp.details[i]; if(detail.isprohibited) { console.writeline($"refurbishing content to ensure compliance."); musicapp.details[i] = musicapp.refurbish(detail); } }