clbTasksToRun_ItemCheck
(
object sender,
ItemCheckEventArgs e
)
{
// AssertValid();
if (!m_bIgnoreItemCheckEvents)
{
// Some tasks are dependent on other tasks. Automatically check or
// uncheck tasks as appropriate.
AutomationTasks eTasksToRun = GetTasksToRun();
Boolean bItemChecked = (e.NewValue == CheckState.Checked);
switch ( ItemToAutomationTask( clbTasksToRun.Items[e.Index] ) )
{
case AutomationTasks.SaveGraphImageFile:
case AutomationTasks.ExportToNodeXLGraphGallery:
case AutomationTasks.ExportToEmail:
if (bItemChecked)
{
eTasksToRun |= (
AutomationTasks.ReadWorkbook
|
AutomationTasks.SaveWorkbookIfNeverSaved
);
}
break;
case AutomationTasks.ReadWorkbook:
case AutomationTasks.SaveWorkbookIfNeverSaved:
if (!bItemChecked)
{
eTasksToRun &= ~(
AutomationTasks.SaveGraphImageFile
|
AutomationTasks.ExportToNodeXLGraphGallery
|
AutomationTasks.ExportToEmail
);
}
break;
default:
break;
}
SetTasksToRun(eTasksToRun);
}
}