ACAT.Extensions.Default.FunctionalAgents.FileBrowserAgent.FileBrowserAgent.handleOpenFile C# (CSharp) Method

handleOpenFile() private method

Handles file open operation. Uses file association to determine which app opens the file. Starts notepad for text files.
private handleOpenFile ( String fileName ) : void
fileName String Name of the file to open
return void
        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);
            }
        }