private void handleOpenFile(String fileName)
{
try
{
String extension = Path.GetExtension(fileName);
if (!activateWindowIfAlreadyOpen(fileName))
{
if (String.IsNullOrEmpty(extension))
{
startWithNotepad(fileName);
}
else
{
Log.Debug("Starting process " + fileName);
var process = Process.Start(fileName);
waitForProcessAndActivate(process);
}
}
}
catch (Exception ex)
{
Log.Error("Cannot start process ", ex);
}
}