private bool Confirm(string TaskName)
{
if (isVista)
{
TaskDialog td = new TaskDialog();
TaskDialogStandardButtons button = TaskDialogStandardButtons.Yes;
button |= TaskDialogStandardButtons.No;
td.Icon = TaskDialogStandardIcon.Information;
td.StandardButtons = button;
td.InstructionText = TaskName;
td.Caption = TaskName;
td.Text = Properties.Resources.Str_Confirm;
TaskDialogResult res = td.Show();
if (res.ToString() != "Yes")
{
return false;
}
}
else
{
DialogResult result = MessageBox.Show(
Properties.Resources.Str_Confirm,
Properties.Resources.Confirm,
MessageBoxButtons.YesNo,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1);
if (result != DialogResult.Yes)
{
return false;
}
}
return true;
}