Here is how I do this one:
Code:
public void Project_DialogBoxShowing(Object sender, DialogBoxShowingEventArgs args)
{
TaskDialogShowingEventArgs args2 = args as TaskDialogShowingEventArgs;
if (null != args2)
{
string s = args2.DialogId;
//MessageBox.Show("Dialog ID is: " + s);
if (args2.DialogId == "TaskDialog_Audit_Warning")
{
args.OverrideResult((int)TaskDialogResult.Yes);
}
if (args2.DialogId == "TaskDialog_Unresolved_References")
{
// Buttons with custom text have custom IDs with incremental values
// starting at 1001 for the left-most or top-most button in a task dialog.
// "Open Manage Links to correct the problem", "1001"
//args2.OverrideResult(1001);
// "Ignore and continue opening the project", "1002"
args2.OverrideResult(1002);
}
}
}