/// <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); }
/// <summary> /// Closes the file browser scanner /// </summary> private void closeScanner() { if (_fileBrowserScanner != null) { Windows.CloseForm(_fileBrowserScanner); _fileBrowserScanner = null; } }
/// <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(); }
/// <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; }