Code:
else
{
TaskDialog var_WSNotEnabled_dialog = new TaskDialog("Workshare Enabler");
var_WSNotEnabled_dialog.MainContent = "Your project is not currently workshared, this process will:"+"\n"+
"- Turn on worksharing."+"\n"+
"\n"+
"Are you sure you wish to proceed?";
var_WSNotEnabled_dialog.TitleAutoPrefix = false;
var_WSNotEnabled_dialog.AllowCancellation = false;
var_WSNotEnabled_dialog.CommonButtons = TaskDialogCommonButtons.Yes | TaskDialogCommonButtons.No;
var_WSNotEnabled_dialog.DefaultButton = TaskDialogResult.No;
TaskDialogResult var_WSNotEnabled_Result = var_WSNotEnabled_dialog.Show();
if(var_WSNotEnabled_dialog.Show() == TaskDialogResult.Yes)
{
//TaskDialog.Show("This is a placeholder", "Yes! :)");
TaskDialog var_ExitDialog = new TaskDialog("H&E Workshare Enabler");
var_ExitDialog.MainContent = "Yes, all that coding time isn't going to waste.";
var_ExitDialog.TitleAutoPrefix = false;
var_ExitDialog.AllowCancellation = false;
//var_ExitDialog.CommonButtons = TaskDialogCommonButtons.Close;
}
else //if (var_WSNotEnabled_Result == TaskDialogResult.No)
{
//TaskDialog.Show("This is a placeholder", "No! :(");
TaskDialog var_ExitDialog = new TaskDialog("H&E Workshare Enabler");
var_ExitDialog.MainContent = "All that coding time wasted.";
var_ExitDialog.TitleAutoPrefix = false;
var_ExitDialog.AllowCancellation = false;
var_ExitDialog.CommonButtons = TaskDialogCommonButtons.Close;
return;
}
}
This is the second part of an if check. Does something if the document is already workshared, otherwise, it steps to the first else in the code above. At that point we run another check - do they want to proceed. Right now I'm flowing to two placeholder dialog boxes. Users clicks yes, dialog 1. No, dialog 2.
The issue: Can someone explain why the second dialog shows if I use the static (commented out above) form, but not the instance? It's driving me bloody crazy...