using XYLEM.Base.Files; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Reflection; namespace XYLEM.Base { internal static class AppConst { static ProgramLogCSVFileClass _Logger = new ProgramLogCSVFileClass(); internal static ProgramLogCSVFileClass Logger { get { return _Logger; } } internal static bool IsBeta { get { return true; //return false; } } // // Summary: // Gets the product version associated with this application. // // Returns: // The product version. internal static string ProductVersion { get { return "1.0.0.1"; } } /// /// Return application MJK No. /// Have to be manuel changed by programmer for every application to fit install! /// /// return ex. "840126" internal static string ProductMainMJKNo() { return "MJK_MAGFLUX_MODBUS"; } /// /// Return MJK Programs standard folder in My documents. /// /// return ex. "c:\...\My Documents\MJK Automation\" internal static string ProgramsUserFolderRootPath() { return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "MJK Automation\\"); } /// /// Return application folder in My documents. /// Have to be manuel changed by programmer for every application to fit install! /// /// return ex. "c:\...\My Documents\MJK Automation\840126\" internal static string ProgramUserFolderRootPath() { return Path.Combine(ProgramsUserFolderRootPath(), ProductMainMJKNo() + "\\"); } /// /// Return application folder to use for user files. /// Have to be manuel changed by programmer for every application to fit install! /// /// return ex. "c:\...\My Documents\MJK Automation\- UserFileSave\" internal static string UserFileSavePath() { return Path.Combine(ProgramsUserFolderRootPath(), "- UserFileSave\\"); } /// /// Return application folder to use for program user settings . /// Have to be manual changed by programmer for every application to fit install! /// /// return ex. "c:\...\My Documents\MJK Automation\840126\UserSettings\" internal static string UserFileSettingsPath() { return Path.Combine(ProgramUserFolderRootPath(), "UserSettings\\"); } /// /// Try Create UserFileSavePath and SettingPath /// internal static void CreateStandardUserFolders() { try { if (!Directory.Exists(UserFileSavePath())) { Directory.CreateDirectory(UserFileSavePath()); } if (!Directory.Exists(ProgramUserFolderRootPath())) { Directory.CreateDirectory(ProgramUserFolderRootPath()); } } catch (Exception ex) { Logger.AddToProgramLogFile(true, "Error creating default user folders ", ex.Message); } } } }