private void ViewOnDownloadButtonClick(object sender, EventArgs eventArgs) { var pt = Values.SafeGetValue <PanelTile>("fileName"); IEnumerable <string> directoryList = null; if (Values.SafeGetValue <TreeNode>("TreeNode") != null && pt != null && pt.Tag != null) { string fileName = ((File)pt.Tag).Name; string filePath = null; directoryList = FileTransfer.GetDirectoryNames(Values.SafeGetValue <TreeNode>("TreeNode")); foreach (string d in directoryList) { filePath += d + "/"; } filePath += fileName; FileTransfer.DownloadFile(filePath); } }