void tools_Click(object sender, EventArgs e)
{
try
{
Cursor.Current = Cursors.WaitCursor;
_setModified = false;
List<MetaSource> sources = new List<MetaSource>();
if (Report != null) sources.AddRange(Report.Sources);
else if (Source != null) sources.Add(Source);
Thread thread = null;
if (sender == _checkSource)
{
thread = new Thread(delegate(object param) { CheckDataSources((ExecutionLogInterface)param, sources); });
}
else if (sender == _refreshEnum)
{
thread = new Thread(delegate(object param) { RefreshEnums((ExecutionLogInterface)param, sources); });
}
else if (sender == _checkExecution)
{
thread = new Thread(delegate(object param) { CheckExecutions((ExecutionLogInterface)param); });
}
else if (sender == _exportSourceTranslations)
{
thread = new Thread(delegate(object param) { ExportSourceTranslations((ExecutionLogInterface)param); });
}
else if (sender == _exportReportsTranslations)
{
thread = new Thread(delegate(object param) { ExportReportsTranslations((ExecutionLogInterface)param); });
}
else if (sender == _synchronizeSchedules || sender == _synchronizeSchedulesCurrentUser)
{
if (!Helper.CheckTaskSchedulerOS()) return;
thread = new Thread(delegate(object param) { SynchronizeSchedules((ExecutionLogInterface)param, sender == _synchronizeSchedulesCurrentUser); });
}
else if (sender == _executeManager || sender == _executeDesigner)
{
string exe = (sender == _executeManager ? Repository.SealServerManager : Repository.SealReportDesigner);
string path = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), exe);
#if DEBUG
path = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath) + string.Format(@"\..\..\..\{0}\bin\Debug", Path.GetFileNameWithoutExtension(exe)), exe);
#endif
Process.Start(path);
}
else if (sender == _openReportFolder)
{
Process.Start(Repository.Instance.ReportsFolder);
}
if (thread != null)
{
ExecutionForm frm = new ExecutionForm(thread);
frm.ShowDialog();
}
if (_setModified && EntityHandler != null) EntityHandler.SetModified();
}
finally
{
Cursor.Current = Cursors.Default;
}
}