Hi @arshad.k ,
Please have a look at these below links
https://giobel.github.io/RevitWarnings/
https://thebuildingcoder.typepad.com/blog/2009/06/autoconfirm-save-using-dialogboxshowing-event.html
https://thebuildingcoder.typepad.com/blog/2010/04/failure-api.html
https://thebuildingcoder.typepad.com/blog/2009/10/dismiss-dialogue-using-windows-api.html
If you follow the steps mentioned in the 2nd link, use this below code
TaskDialogShowingEventArgs e2;
e2.OverrideResult((int)DialogResult.OK);
I hope this helps.