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

onFileSelected() private method

User selected a file from the list. If reqd, ask the user if she wants to open or delete the file
private onFileSelected ( FileInfo fileInfo ) : bool
fileInfo FileInfo FileInfo of the file selected
return bool
        private bool onFileSelected(FileInfo fileInfo)
        {
            bool doHighlightOff = true;

            if (fileInfo != null && File.Exists(fileInfo.FullName))
            {
                FileOperation operation = FileOperation.None;
                if (SelectActionOpen)
                {
                    if (DialogUtils.ConfirmScanner(string.Format(Resources._confirmActionVerb, ActionVerb, fileInfo.Name)))
                    {
                        operation = FileOperation.Open;
                    }
                }
                else
                {
                    operation = getFileOperationFromUser(fileInfo);
                }

                if (operation != FileOperation.None)
                {
                    handleFileOperation(operation, fileInfo);
                    if (operation == FileOperation.Open)
                    {
                        doHighlightOff = false;
                    }
                }
                else
                {
                    SelectedFile = String.Empty;
                }
            }

            return doHighlightOff;
        }