This class is designed to be used in the worker thread.
Some methods block thread while waiting for the response.
/// <summary> /// Constructor /// </summary> public SFTPForm(Form ownerForm, SFTPClient sftp, string connectionName) { InitializeComponent(); if (!this.DesignMode) { this._sftp = sftp; this._ownerForm = ownerForm; this._remoteName = connectionName; this.Text = "SFTP - " + connectionName; this.progressBar.Maximum = PROGRESSBAR_MAX; PrepareTreeIcons(); SetIcon(); SetText(); ClearProgressBar(); // Note: Setting TreeViewNodeSorter property enables sorting. treeViewRemote.TreeViewNodeSorter = new NodeSorter(); } }
private void SFTPForm_FormClosed(object sender, FormClosedEventArgs e) { if (_ownerForm != null) { _ownerForm.FormClosed -= new FormClosedEventHandler(_ownerForm_FormClosed); _ownerForm = null; _sftp = null; } }