public void Close(bool Success) { if (TransferControl != null) { TransferControl.Hide(); TransferControl.CancelClicked -= TransferControl_CancelClicked; } if (Success) { Display.PrintAtStart("Transfer SUCCESS"); } else { Display.PrintAtStart("Transfer FAILED"); } if (this.Transport != null) { StopTimer(); CurrentSession.Transfer = null; Display.PrintAtStart("Transfer session closed."); if (this.Transport != null) { CurrentSession.Transport = Transport; Transport = null; } } else { Display.PrintAtStart("Already complete but Close() called again."); } }
public void SendFile(Session CurrentSession, string Filename) { FileInfo info = new FileInfo(filename); TransferControl.Protocol = "XMODEM"; TransferControl.Filename = System.IO.Path.GetFileName(Filename); TransferControl.Operation = "Send"; TransferControl.BytesToSend = info.Length; TransferControl.BytesSent = 0; TransferControl.ClearTimer(); TransferControl.CancelClicked += TransferControl_CancelClicked; TransferControl.Show(); }