I have following code:
File.Copy(pathSource, pathDestination); //copy file
ID3v2TagToDB(pathSource, pathDestination); //read his tags and save them to DB
ID3v2TagToTXT(pathSource, pathDestination); //read his tags and save them to txt
dgv.Rows[chosen[i]].DefaultCellStyle.BackColor = Color.GreenYellow; //color green datagridview row if copy and read successfull
I want to ensure that each operation is successfull. If any of them failed, I need to rollback all previous ones.
And also, warn user about error that ocurred, and operation that ocurred in.