private void Download_Click(object sender, RoutedEventArgs e) { try { SettingsServer.sFile sFile = (SettingsServer.sFile)dtgFiles.SelectedItem; TempDataHelper.FileName = sFile.fName; TempDataHelper.FileExt = sFile.fExt; MainServer.Send(ConnectionID, Encoding.UTF8.GetBytes("GetFile{[" + currentDir.Text + @"\" + sFile.fName + "E<E" + sFile.fExt + "]}")); } catch { } }
private void DeleteFile_Click(object sender, RoutedEventArgs e) { try { SettingsServer.sFile sFile = (SettingsServer.sFile)dtgFiles.SelectedItem; if (sFile.fExt != "Папка с файлами") { MainServer.Send(ConnectionID, Encoding.UTF8.GetBytes("DeleteFile{" + currentDir.Text + @"\" + sFile.fName + sFile.fExt + "}")); } } catch { } }
private void dtgFiles_MouseDoubleClick(object sender, MouseButtonEventArgs e) { try { SettingsServer.sFile a = (SettingsServer.sFile)dtgFiles.SelectedItem; if (a.fExt == "Папка с файлами") { if (currentDir.Text[currentDir.Text.Length - 1] != '\\') { currentDir.Text += "\\"; } CurDir = a.fName; MainServer.Send(ConnectionID, Encoding.UTF8.GetBytes("GetDF{" + currentDir.Text + a.fName + "}")); } else { MainServer.Send(ConnectionID, Encoding.UTF8.GetBytes("TryOpen{" + currentDir.Text + @"\" + a.fName + a.fExt + "}")); } } catch { } }