示例#1
0
        /// <summary>
        /// Invoked when the Functional agent is activated.  This is
        /// the entry point.
        /// </summary>
        /// <returns>true on success</returns>
        public override bool Activate()
        {
            _alphabetScannerShown = false;
            _autoLaunchFile       = false;
            ExitCode = CompletionCode.ContextSwitch;

            _fileBrowserScanner = Context.AppPanelManager.CreatePanel("FileBrowserScanner") as FileBrowserScanner;
            if (_fileBrowserScanner != null)
            {
                _fileBrowserScanner.FormClosing          += _form_FormClosing;
                _fileBrowserScanner.EvtFileOpen          += _fileBrowserScanner_EvtFileOpen;
                _fileBrowserScanner.EvtDone              += _form_EvtDone;
                _fileBrowserScanner.SelectActionOpen      = SelectActionOpen;
                _fileBrowserScanner.IncludeFileExtensions = IncludeFileExtensions;
                _fileBrowserScanner.ExcludeFileExtensions = ExcludeFileExtensions;
                _fileBrowserScanner.Folders               = Folders;
                _fileBrowserScanner.ActionVerb            = ActionVerb;
                SelectedFile = String.Empty;
                Context.AppPanelManager.ShowDialog(_fileBrowserScanner);

                return(true);
            }

            return(false);
        }
示例#2
0
 /// <summary>
 /// Closes the file browser scanner
 /// </summary>
 private void closeScanner()
 {
     if (_fileBrowserScanner != null)
     {
         Windows.CloseForm(_fileBrowserScanner);
         _fileBrowserScanner = null;
     }
 }
示例#3
0
        /// <summary>
        /// Form is closing. Cleanup
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void _form_FormClosing(object sender, FormClosingEventArgs e)
        {
            _fileBrowserScanner.EvtDone     -= _form_EvtDone;
            _fileBrowserScanner.EvtFileOpen -= _fileBrowserScanner_EvtFileOpen;
            _fileBrowserScanner              = null;

            // re-initialize for next time
            initProperties();
        }
示例#4
0
        /// <summary>
        /// Form is closing. Cleanup
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void _form_FormClosing(object sender, FormClosingEventArgs e)
        {
            _fileBrowserScanner.EvtDone -= _form_EvtDone;
            _fileBrowserScanner.EvtFileOpen -= _fileBrowserScanner_EvtFileOpen;
            _fileBrowserScanner = null;

            // re-initialize for next time
            initProperties();
        }
示例#5
0
 /// <summary>
 /// Closes the file browser scanner
 /// </summary>
 private void closeScanner()
 {
     if (_fileBrowserScanner != null)
     {
         Windows.CloseForm(_fileBrowserScanner);
         _fileBrowserScanner = null;
     }
 }
示例#6
0
        /// <summary>
        /// Invoked when the Functional agent is activated.  This is
        /// the entry point.
        /// </summary>
        /// <returns>true on success</returns>
        public override bool Activate()
        {
            _alphabetScannerShown = false;
            _autoLaunchFile = false;
            ExitCode = CompletionCode.ContextSwitch;

            _fileBrowserScanner = Context.AppPanelManager.CreatePanel("FileBrowserScanner") as FileBrowserScanner;
            if (_fileBrowserScanner != null)
            {
                _fileBrowserScanner.FormClosing += _form_FormClosing;
                _fileBrowserScanner.EvtFileOpen += _fileBrowserScanner_EvtFileOpen;
                _fileBrowserScanner.EvtDone += _form_EvtDone;
                _fileBrowserScanner.SelectActionOpen = SelectActionOpen;
                _fileBrowserScanner.IncludeFileExtensions = IncludeFileExtensions;
                _fileBrowserScanner.ExcludeFileExtensions = ExcludeFileExtensions;
                _fileBrowserScanner.Folders = Folders;
                _fileBrowserScanner.ActionVerb = ActionVerb;
                SelectedFile = String.Empty;
                Context.AppPanelManager.ShowDialog(_fileBrowserScanner);

                return true;
            }

            return false;
        }