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

_fileBrowserScanner_EvtFileOpen() private method

Event handler for when the user selects a file. Depending on the configuration, either the file will be opened or the name of the file will be returned to the caller. The SelectedFile property will contain the name of the selected file.
private _fileBrowserScanner_EvtFileOpen ( object sender, EventArgs e ) : void
sender object event sender
e System.EventArgs event args
return void
        private void _fileBrowserScanner_EvtFileOpen(object sender, EventArgs e)
        {
            _autoLaunchFile = AutoLaunchFile;
            SelectedFile = _fileBrowserScanner.SelectedFile;

            var extension = Path.GetExtension(SelectedFile);

            if (String.IsNullOrEmpty(FileUtils.GetFileAssociationForExtension(extension)))
            {
                if (!DialogUtils.ConfirmScanner(PanelManager.Instance.GetCurrentForm(),
                                Resources.NoProgramAssociatedWithFileOpenAnyway))
                {
                    return;
                }
            }

            closeScanner();

            if (_autoLaunchFile && !String.IsNullOrEmpty(SelectedFile.Trim()))
            {
                handleOpenFile(SelectedFile);
            }
            else
            {
                ExitCode = CompletionCode.None;
            }

            Close();
        }