using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tango.DispenserAnalyzer.UI { public static class FileHelper { private const string FILE_EXTENSION = ".pdf"; private const string FILE_EXEL_EXTENSION = ".xlsx"; public static string OpenFilePath{ get; set; } public static string GetResultFilePath() { if (File.Exists(OpenFilePath)) { var ext = Path.GetExtension(OpenFilePath); var dir = Path.GetDirectoryName(OpenFilePath); var resultFile = Path.Combine(dir, string.Format("{0}-result{1}", Path.GetFileNameWithoutExtension(OpenFilePath), FILE_EXTENSION)); return resultFile; } return ""; } public static string GetFileToSaveFlowRangeToTimeData( int extNumber) { if (File.Exists(OpenFilePath)) { var ext = Path.GetExtension(OpenFilePath); var dir = Path.GetDirectoryName(OpenFilePath); var resultFile = Path.Combine(dir, string.Format("{0}_rangeToTime{1}{2}", Path.GetFileNameWithoutExtension(OpenFilePath), extNumber.ToString(), FILE_EXEL_EXTENSION)); return resultFile; } return ""; } } }