public void StartNew(WinFileSystem win, ClientInfo client, FileFolderInfo selectedFile) { ControlledClient = client; string path = FileSystemDialog.GetSaveFile(null, true, false, selectedFile.Name); if (path != null) { FileTransmissionInfo trans = new FileTransmissionInfo() { File = selectedFile }; try { download = new DownloadingInfo(win, client, path, trans); } catch (Exception ex) { TaskDialog.ShowException(ex, "建立本地文件失败!"); return; } Telnet.Instance.FileSystemDownloadErrorReceived += FileSystemDownloadErrorReceived; Telnet.Instance.FileSystemDownloadPartReceived += FileSystemDownloadPartReceived; Telnet.Instance.Send(new CommandBody( File_AskForDownloading, Global.CurrentClient.ID, client.ID, trans)); download.Dialog.ShowDialog(); } }
public CtrlWinBase(Common.Model.ClientInfo client) { ControlledClient = client; Telnet.Instance.NoSuchClient += (p1, p2) => { if (p2.Content.BId == client.ID) { Dispatcher.Invoke(() => { TaskDialog.Show("找不到对应的被控端或被控端失去连接"); Close(); }); } }; }
public WinScreen(Common.Model.ClientInfo client) : base(client) { InitializeComponent(); }